A few others and myself have recently inherited an application that uses the Fitbit to access information about a user that has given our application permission to see their uploaded information to the Fitbit database.
Since the project was started a few years back and multiple teams have worked on this application, the credentials to the original developer account on Fitbit were lost. Since then, I have created another developer account and implemented all of the new Fitbit credentials to use for receiving information such as the Authorization Code to add a new subscriber to our database.
Right now, our application can successfully add a user to our database along with the Fitbit access token, refresh token, user ID returned from Fitbit, etc. The problem now however is that we cannot manage to receive anything but a 400 Bad Request back from Fitbit when trying to add a subscriber to our application. The API is written in Flask and below is the request we are currently creating to try and send the request to for the subscription. We had to add in the content-length since the last group didn't have it in there since it was before that header was required. I am also using Postman to test these endpoints.
authHeader = "Bearer " + newCaregivee.fitbitAccessToken
header = {"Authorization": authHeader, "content-length": "0"}
str(newCaregivee.caregiveeID) + ".json"
My first thought is that we are using a '-' to simulate a currently logged in user. Should I change that to the encoded userID of the user for testing? If so, how would I get that? The page I have been referencing:
Create Subscription