Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error while retrieving life time stats through fitbit web api

I requested the life time stats of fitibit of currently logged in user using the following request

 

GET, https://api.fitbit.com/1/user/-/activities.json

Header, Authorization: Bearer ...token

 

I got the following response

 

{
	"errors": [
		{
			"errorType": "request",
			"fieldName": "500",
			"message": "An error occurred with the Fitbit Web API while processing the request. Error id: AC443E16:5175_A92D900A:01BB_5A9E2A37_D977252A:0A43"
		}
	],
	"success": false
}

I also tried to provide user id but same response

 

Please guide me if I am missing something or how to get life time stats of currently logged in user.

 

 

Best Answer
0 Votes
7 REPLIES 7

I am having the same issue.  It's working fine for one user-token pair but the other developers on my team have been getting this error when trying to use their own fitbit account.

Best Answer
0 Votes

To clarify, the only thing for me that is different to receive this error instead of a successful response is the token. The token associated with my account works, the token for any other does not.

 

If I send something as 'token' which is definitely not a token, the API responds appropriately with 

{ "errors": [
{"errorType": "invalid_token",
"message": "Access token invalid: jkahjldashjlafsdjl. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],
"success": false}

Best Answer
0 Votes

I am having the same issue. The https://api.fitbit.com/1/user/-/activities.json always returns a 500: {"errors":[{"errorType":"request","fieldName":"500","message":"An error occurred with the Fitbit Web API while processing the request. Error id: AC44E234:398D_A92D900A:01BB_5AB8D50C_A8E465B5:0A43"}],"success":false}

I use the same token as I do for other calls but only this one fails.

 

Best Answer
0 Votes

Can someone try this on the api explorer here:

https://dev.fitbit.com/build/reference/web-api/explore/#

 

Click authorize

select activity checkbox

close authorization page

Expand GET/1/user/-/activities.json

Click try it out

Click execute

Compare the Curl statement generated to yours?

 

Best Answer
0 Votes

I just tried it and this is the response I get for:

curl -X GET "https://api.fitbit.com/1/user/-/activities.json" -H "accept: application/x-www-form-urlencoded" -H "authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2SkI1WDIiLCJhdWQiOiIyMjdHNUwiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJ3YWN0IiwiZXhwIjoxNTIyMjIxNjAxLCJpYXQiOjE1MjIxMzUyMDF9.It8OpqODQjdecy2Oi5VqcdP_3U1qZUpKvp5-H28SQ68"

 

{"errors":[{"errorType":"request","fieldName":"500","message":"An error occurred with the Fitbit Web API while processing the request. Error id: AC44E234:3CD7_A92D826B:01BB_5AB9F0B5_A1CC3CFF:35B9"}],"success":false}

 

Best Answer
0 Votes

Once again tried this, for my original account curl runs fine with the SwaggerUI 

curl -X GET "https://api.fitbit.com/1/user/-/activities.json" -H "accept: application/x-www-form-urlencoded" -H "authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzWFA4R0oiLCJhdWQiOiIyMjdHNUwiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJ3YWN0IiwiZXhwIjoxNTIyMjQ5ODA3LCJpYXQiOjE1MjIxNjM0MDd9.caA6X_rzAEfrK2DCJnnMstwWD5qkQfUWMMK_Xgtecsw"

Returns all stats as expected

 

But logged into a dummy account I made to try and replicate the problem this curl:

curl -X GET "https://api.fitbit.com/1/user/-/activities.json" -H "accept: application/x-www-form-urlencoded" -H "authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2SkRTRlciLCJhdWQiOiIyMjdHNUwiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJ3YWN0IiwiZXhwIjoxNTIyMjQ5OTQzLCJpYXQiOjE1MjIxNjM1NDN9.p_m4aAvTWbnGoTmgrJmBCOUDOC8hxWQ9zbZPgYOXX7E"

returns:

{"errors":[{"errorType":"request","fieldName":"500","message":"An error occurred with the Fitbit Web API while processing the request. Error id: AC45463B:35EF_A92D900A:01BB_5ABA5F61_B5886AED:0A43"}],"success":false}

headers:

 cache-control: no-cache, private  content-language: en  content-type: text/plain 
Best Answer
0 Votes

A bug is filed and will provide ETA after the team triages it

Best Answer
0 Votes