03-07-2018
03:24
- last edited on
03-21-2018
09:18
by
RobertoME
03-07-2018
03:24
- last edited on
03-21-2018
09:18
by
RobertoME
I am in the process of creating an app that uses FitBit and the data it collects to help track mental health. I'm creating it to manage my own bipolar disorder, but it could just as easily apply to managing anxiety and depression as well.
My app in short will take data from the FitBit such as exercise and sleep and develop relationships between sleep, exercise and your mood. The longer you use the app the more ccurate the relationship between the sleep, exercise and mood will be with a goal of being able to provide a predictive set of data, so say if you're mildly depressed the app may suggest running for 20 minutes 3 days a week for 2 weeks or sleeping 6.5 hours a night for 4 days or something to that nature. Is that the type of thing that you would be looking for? I plan to have my app available for testing in a couple months and publicly available later this year.
Moderator Edit: Updated Subject For Clarity.
03-17-2018 01:14
03-17-2018 01:14
I know its been a while since you posted @Kforshey but how is your app getting on? Did you manage to complete it?
03-17-2018 05:05
03-17-2018 05:05
It’s still in development at the moment. I’m hoping to be testing it with a limited number if users in a month or two(I work a full time job in addition to this so it’s taking longer than I’d like).
03-18-2018 04:28
03-18-2018 04:28
It sounds like an interesting project, and I'd be really interested in see what you come up with when its all complete. I've done allot of work with the API already, so if I can help with anything let me know
03-18-2018 04:37 - edited 03-18-2018 05:05
03-18-2018 04:37 - edited 03-18-2018 05:05
My only question at this point is how to setup the OAuth endpoints on my web service so that I can register as a fitbit developer nd communicate withe the API. Is this just an endpoint that we create? I’m not sure what FitBit is looking for at that point.
Once I get the endpoint thing figured out I’ll be almost ready to put a beta version live.
03-18-2018 06:02
03-18-2018 06:02
I assume you're web service is creating user accounts and storing them in a database so since you'll want your app to be able to pull users information without them being logged in you'll need to get your users to authorise your app, and have your app store the authorise codes for later use.
What laugangue are you writing in? I've written heavily in PHP already, but just finished helping someone else in the forums with their Android application.
03-18-2018 07:01
03-18-2018 07:01
Thanks so much for your reply. I’m using .net (c# specifically). I’m working on a web version now to get user feedback and do some acceptance testing, but when that’s done I’ll have an Android and Ios app written in Xamarin forms. My web service now is a wcf app. I was assuming I’d have to save user credentials in my database somewhere (created a table for that this morning actually).
Once we save the user credentials are we just able to hit the FitBit web api?
03-18-2018 09:33
03-18-2018 09:33
Unforunitly I can't help you with the coding for C#, it's not a language I've had to learn yet.
But the principle of the Fitbit API is easy enought. There is a tutorial on the Web API forums, but basically you would send your users off to Fitbit to verify your app's access, then store the returned authentication codes and with them you can query the API any time you like - for example as part of a scheduled update script. I would suggest storing what the API returns though since there is a 150 calls/per user/hour limit. So if your calling the same end points several times you can hit that fairly quickly.
A second thought would be, when you create your Android/iOS apps it might be easier to get them pulling information from your web service rather than Fitbit its self.
I wrote my app to scratch my own itch and pull information from Fitbit, and recorded moods/medications (and anything else really) using Nomie with a nice Ionic app I've been developing to help me record things easily.
Part of my plan was the simillar to yours and try and get a better understanding of what out-side-factors are affecting, or driving, my mood. So far I've focused on encouragment with stretch goals, gradual improvment goals, some story walks (Lord of the Rings & The Hobbit) and a little bit of gamification powered by Habitica. But my moods been 'swinning' lately and was starting to work on the original idea so I'm really intrigued with your approach and love your idea of offering suggestions for how to improve the situation.
I don't know if you plan to make your software freely available or are intending it as a comercial service so I'll understand if you don't want to go into details, but if your open to sharing I'd love to incorperate this idea into my own project.
If your not open to sharing (which I fully understand) I'm still available to help if you need any when you start working with the API
03-18-2018 11:47
03-18-2018 11:47
I get the basic premise of using an OAuth2 library to validation user credentials. My big thing I guess is the whole developer registration process. How do we get access to this web API to finish an application when the registration process requires your API endpoints (which I assume they mean endpoints defined in my web service), plus the legal stuff like terms of service etc. for an app still in the development phase?
Or are we just supposed to put in dummy information and then update at later point?
Other than that I think everything I need for framework layer stuff will be able to be done by either using fitbit.net directly or wrapping in some pretty methods to get data flowing to my database.
Thanks for all your help by the way.
03-18-2018 11:53
03-18-2018 11:53
Getting access is the easy bit. Just head over to https://dev.fitbit.com and in the top menu Manage click on Register An App it'll take you too the registration form and a link to the ToS is down the bottom.
03-18-2018 11:56
03-18-2018 11:56
O and the API endpoints usually mean Fitbit's endpoint.
For example the Sleep's API endpoint is
https://api.fitbit.com/1.2/user/[user-id]/sleep/date/[date].json
03-18-2018 12:00
03-18-2018 12:00
so If I understand that correctly, then these are the endpoints that my web services are planning on sending data to, and Fitbit needs to know this so our APIs can do a little dance together? That is so much easier than I thought. I thought they needed us to create an endpoint within our own application and give that to them.
That makes everything much simpler (typical developer over complicating things in my head).
10-07-2018 15:23
10-07-2018 15:23
I'm so glad to see an update on this project of yours! As someone with bpd who uses my fitbit religiously I think the app you are in the process of making will be super helpful, I hope fitbit make it an easy process to be approved as I know if I was on the fence about buying one the app your planning would make up my mind for me, definitely gives them a competitive advantage as I haven't seen anything alike what you are making , will check back in November to see how your getting along as I'm really interested in downloading the app when it's available. Good luck and thank you !
10-07-2018 15:44
10-07-2018 15:44
Hi,
thanks for inquiring about my app. I’m refactoring a few things and making a few changes and should be launching this app in the near future. Like within a month or two.
09-28-2020 23:04
09-28-2020 23:04
I’m bipolar, my son just was diagnosed. I’m interested in what you have been able to accomplish since this post.