07-08-2019 01:16
07-08-2019 01:16
I would like to create & log custom activities in FitBit. I know you are not keen on 3rd party apps retrieving detailed activities, but is it allowed for apps to only retrieve the activities logged by themselves? For example, I would like to create an app where it logs activities while working at a desk, then I want to show these activities as well (so need to be able to retrieve them again).
So the app does not need any access to other activities then the ones it creates itself.
Note: also asked here, but the FitBit dev account on Twitter pointed me to this forum
07-09-2019 14:04
07-09-2019 14:04
Hi @SunsetRunner
Your application may create/post activities on to a user's Fitbit account as long as the user has given consent to your application to read/write activity data using the Authorization Flow.
If a user has given your application permission to read/write activities on their Fitbit account, you can use the POST Log Activity endpoint to create a log entry for an activity or user's private custom activity using units in the unit system which corresponds to the Accept-Language header provided (or using optional custom distanceUnit) and get a response in the format requested.
POST https://api.fitbit.com/1/user/[user-id]/activities.json
After creating a log, you can then execute the GET Activity Daily Summary or Logs List endpoint to retrieve the activity data.
GET https://api.fitbit.com/1/user/[user-id]/activities/date/[date].json
GET https://api.fitbit.com/1/user/[user-id]/activities/list.json
I hope this helps! Let me know if you have any additional questions.
07-09-2019 14:56
07-09-2019 14:56
Thanks @JohnFitbit for the reply. My users want to see detailed activities back in the app (for the custom activities) on a minute by minute basis. Would something like that be possible for custom activities? The app is not interested in any other detailed (personal app) stats.
Thanks!
07-24-2019 10:57
07-24-2019 10:57
Hi @SunsetRunner,
I apologize for the delayed response.
When you say custom activities, are you referring to manually logged activities? For example, a user wants to manually log activity in the app instead of tracking it with auto-recognition or exercise mode on the device.
If so, you can manually log this activity and extract minute by minute data from it as long as the user is wearing a device during the specified time that this activity took place, using the GET Activity Intraday Time Series and the GET Heart Rate Intraday Time Series endpoints
You can also specify which data to single out when using the Get Activity Intraday Time Series endpoints:
activities/calories activities/steps activities/distance activities/floors activities/elevation
I hope this helps clarify things. Please let me know if you have any additional questions.