Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Subscriptions - Responding to Notifications

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

Best Answer
1 REPLY 1

Hi @Healthcarechan 

 

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.   

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes