09-09-2024 04:04
09-09-2024 04:04
Hi all,
We haven't made any changes on our side within the past 3 months, but as of 30/08 we are seeing intermittent 400 INVALID ARGUMENT errors, seemingly only when fetching the current day's activities.
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Example request URL:
https://api.fitbit.com/1/user/-/activities/steps/date/{TODAY'S_DATE}/1d/1min.json?timezone=utc
As I say we haven't made any changes on our side lately, has there been any changes on the fitbit side as of late?
09-09-2024 11:59
09-09-2024 11:59
UTC should be in upper case, not lower case. Would you please change your code and let me know if you are still seeing the intermittent 400 errors?
09-10-2024 01:42 - edited 09-10-2024 01:44
09-10-2024 01:42 - edited 09-10-2024 01:44
Hi @Gordon-C I wouldn't have thought that would be an issue as we're only ever calling the fitbit endpoint in the format provided above, and we are seeing a majority of correct responses returned with 'utc' being sent in lowercase.
Interestingly it does seem to only happen between 01:00 - 10:30 BST (00:00 - 09:30 UTC) so I'm wondering if this is actually erroring due to some timezone issues / date being interpreted as being in the future or something along those lines.
Not sure if the same error message would be returned if selecting a date in the future though.
09-11-2024 09:09
09-11-2024 09:09
I believe I know what is occurring here. When a user records step data, we are storing that data in the user's timezone. When you query a date in the future, the error
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
is returned. I'll need to check with engineering to see if you can query a date in the future. If you cannot, that error message could be more helpful by instructing you that querying a date in the future is not allowed. When you use the query parameter "timezone=UTC", we are reconciling the data to UTC. If UTC is in the future of BST, then the error would occur because you're querying data in the future which appears not to be allowed.
09-18-2024 03:15
09-18-2024 03:15
Hey @Gordon-C thanks for the reply!
Did you get a chance to confirm that this was indeed the case before we make any changes on our end?