10-02-2024 11:53
10-02-2024 11:53
Our app currently POSTs activities that represent workouts /v1/user/-/activities with the intent that these activities would appear in the user's Fitbit logs. Recently we have been getting lots of user reports from our users indicating that our workouts are no longer automatically recorded in their Fitbit activity logs. After some investigation, we've observed the following:
In the past, activities we created were automatically logged in Fitbit as well. Has there been a recent intentional change on how this works?
Thanks
10-03-2024 13:22
10-03-2024 13:22
Hi @FitbodDevs
I don't think I'm reproducing the problem you are reporting. Please correct me if this is not what is occuring.
Are these to same steps you are following to reproduce this problem? Would you please provide me with the endpoint syntax you're calling in your application?
Thanks!
10-03-2024 15:27
10-03-2024 15:27
Yes those steps are correct but we are seeing a different result based on user reports and our own internal testing. We've had the Fitbit integration into our app for awhile now and it worked as expected until about a month ago (Mid September) when we first started getting reports on the issue from our users.
Regarding the syntax which you asked for, we send a POST request with the header Content-Type as application/x-www-form-urlencoded and the parameters to create the activity are in the POST body.
Some other observations:
10-04-2024 11:53
10-04-2024 11:53
Would you please provide me with the exact syntax you're using to create the activty so I can try to reproduce the problem you are seeing?
10-04-2024 12:51
10-04-2024 12:51
I'm not clear on what you mean by syntax: Here an example cURL of the POST request we're making though
curl 'https://api.fitbit.com/1/user/-/activities.json' \
-X POST \
-H 'Host: api.fitbit.com' \
-H 'Connection: keep-alive' \
-H 'Accept: */*' \
-H 'User-Agent: fitbod/6.44.0 (iPhone; iOS 18.0; Scale/3.00)' \
-H 'Accept-Language: en-US;q=1' \
-H 'Authorization: Bearer [redacted]' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw 'activityName=Fitbod%3A%20Shoulders%2C%20Triceps&date=YYYY-MM-DD&durationMillis=6000&manualCalories=78&startTime=12%3A43%3A05'
Note: I had to remove the date from the --data-raw above as I was getting some error when attempting to post that did not allow it to be posted for some reason. The property date value would be Oct 4, 2024.
Also redacted my auth token
Let me know what other specific information would be useful
10-21-2024 10:48
10-25-2024 10:17
10-25-2024 10:17
Hi @FitbodDevs
I've been chatting with someone in the Fitbod Eng team about this exact problem. The Create Activity Log endpoint does not support sending the recorded activity data as body parameters. You need to send the information as query parameters. See https://dev.fitbit.com/build/reference/web-api/activity/create-activity-log/.
Try changing your curl command to use query parameters to see if that fixed the problem.