05-16-2021 00:43
05-16-2021 00:43
Hi there.
I have a subscriber endpoint set up with notifications coming in.
When a user logs an activity, what type of subscription notification is sent?
Does it come in the format below as a post of the endpoint URL?
[
{
"collectionType": "activities",
"date": "2020-06-01",
"ownerId": "184X36",
"ownerType": "user",
"subscriptionId": "2345"
}
]
To see more activity, I'm calling the URL format below, which of the token? subscriber account token or user token?
https://api.fitbit.com/1/{ownerType}/{ownerId}/{collectionType}/date/{date}.json
05-17-2021 10:15
05-17-2021 10:15
You are correct. The incoming notification will arrive in the format you listed. Once you receive the notification, you'll need to respond with a 204 within 5 seconds to acknowledge receipt. See https://dev.fitbit.com/build/reference/web-api/subscriptions/#responding-to-a-notification. You'll use the Bearer or access token to retrieve the user data.