07-17-2015 01:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-17-2015 01:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I have got two simple questions about fitbit app. I want to create an application which will fetch data from user account. Therefore I created an fitbit account and I got credentials for my account. Now I want to create an app with which I will fetch data from the user web api. I found this video which contain a PHP approach for fetching data. My application is in Unity so I want to track data, so is there a way to use c# or .net app. Is there any link or tutorial on how to fetch data using c#? Which is the maxinum frequency of fetching data using web api?
Answered! Go to the Best Answer.
Accepted Solutions
08-18-2015 07:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2015 07:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
07-18-2015 17:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-18-2015 17:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hey,
I'm using Unity as well and it is possible but one of the things you'll have to decide on is either
1. Your user will copy the return code from your authentication request so you can complete it and get the data from Fitbit
2. Get a Webview so you can automatically grab the code and do it all behind the scenes
It depends on what you want to do with the app in the end I guess.
If you go with the webview approach I actually just did a write up on how I did Fitbit OAuth 2 in Unity which you can find HERE

07-20-2015 00:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-20-2015 00:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@TEvashkevich thanks for the reply and for ur blogpost. I am not sure that I understand the difference between the two solutions u mention. Actually I am having a Unity application and when the user (which wears a fitbit) press a button I want to activate the data tracking for the fitbit and store several user information such as Heart rate for example and display it to my app real time(or near real time).

07-21-2015 10:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-21-2015 10:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
You can't get exactly real time data.
The difference is:
-One the User has to put in the return code/pin so that YOUR PROGRAM can fetch the fitbit data and then display it
OR
You use a webview to be able to get the return code automatically without the user doing anything.

07-23-2015 03:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2015 03:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
It seems that the second option is what I want. I want to automatically track data from user. What you mean you can't get exactly real time data? What will going to be closer to real time?

07-24-2015 14:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-24-2015 14:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
well especially without you having Fitbit Partner level access, you can't get realtime access and the tracker syncs every 15 mins (as far as I've been able to see from Fitbit Dev posts.)
If you want to auto do stuff and want to do your program in Unity you will need to setup/buy a Webview then.

08-17-2015 05:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-17-2015 05:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
If I have Fitbit Partner level access, is it possible to fetch real time data?

08-18-2015 07:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2015 07:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Check my sollution here: https://community.fitbit.com/t5/Web-API/How-to-get-started/m-p/909319#M2867
08-19-2015 00:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-19-2015 00:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@freeubi thanks for the help, my main issue, if is possible to communicate and fetch data real time? How is it possible to do so?

08-19-2015 01:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-19-2015 01:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The real real-time communication is not possible - simply because you cant communicate the device vie bluetooth.
The subscriptions are the most close that you want: you can get notifiations that the user finised an exercise or updated the data (of course, they need to have internet conenction and sync the device, but the most countries this is not a problem)
Currently i'm developing this to my application, i have a few things working, but not everything.

08-19-2015 01:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-19-2015 01:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Since I am trying to investigate if fitibit is appropriate with my project I want to have real time or near real time Heart rate and steps. I found that I can sync data every 15min. Which are the case with prenium account? Moreover I have noticed that in my android application my data are syncronized real time without doing anything, How can I fetch those data?

08-19-2015 02:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-19-2015 02:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
No way that you can access realtime HR data.

08-19-2015 02:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-19-2015 02:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@freeubi thanks for the help!

02-23-2016 20:47 - edited 02-23-2016 20:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-23-2016 20:47 - edited 02-23-2016 20:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Not sure I agree. You can access HR data as of 1-10 seconds ago. To me, that is real time (OF THE SYNCED PORTAL DATA). No, you cannot pull real-time FROM THE DEVICE.
See this thread - I am already able to chart per second HR data for any period although the fetch limits will limit to 24hrs or less per query.
I need to figure out why the non-webview "client_credentials" grant type token is not being accepted in the data request, when the standard webview grant type of "authorization_code" pulls it fine (but needs manual authorization per session.
Nothing in the darn Fitbit API oauth2 docs indicate that grant type is not allowed so I am getting really frusterated. Like I said - my calls work 100% but I do not want to have to use a redirecturi and the proper oauth2 APP based method is to then use grant type of "client_credentials". That darn call even works, it just throws a 400 bad request when using that darn proper token. It even has a proper 3600 sec expiration set so the ONLY error is the subsequent data GET call.

