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

Subscription API process flow and OAuth 2.0 for a mobile app

I am developing a mobile app that needs to display a user's fitbit data to them with additional data.  As this is a mobile app and not a web application, I am confused about the process flow for fulfilling the OAuth 2.0 needs.  On the fitbit registration screen, it is asking for a callback url, but as this is a mobile app, how would I provide a callback url or use it with my mobile app?  For the subscription api process flow, would a user

 

1) login using the oauth 2.0 process,

2) approve the necessary permissions for my app,

3) a user activity or body metrics are measured by the fitbit device and uploaded to fitbit backend,

4) fitbit sends my app a notification that something new is available or would it just send the new data that is available?

Best Answer
0 Votes
3 REPLIES 3

Hi @dever_node1,

 

Maybe some mobile application developers who read the forums can provide you with some details.  From what I have seen, you should be able to register a URL for your mobile app (i.e. my://) and use that URL for your callback URL (i.e. myapp://callback).

 

The flow you've described is correct.  In step 4, Fitbit will send your application a webhook notifying you that the Fitbit user has updated their activity or body data.  The notification will look something like this.

{
    "collectionType": "activities",
    "ownerId": "22PT4L",
    "ownerType": "user",
    "subscriberId": "3",
    "subscriptionId": "123"
}

The updated data does not appear in the notification.  Instead, you will need to execute one of the activity or body endpoints to retrieve the updated data.

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

Do you still have the same rate limits?

Best Answer
0 Votes

Here is the current information on our rate limits: https://dev.fitbit.com/build/reference/web-api/basics/#rate-limits

 

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