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

Requests for Intrady Daya fail at 11 PM UTC

Hello all,

I made a web app running on Heroku, retrieving 30 min of Intraday HeartRate every 15 minutes in UTC format. It works correctly all day. With a little trick, the data "around midnight" is retrieved in 2 batches at 00:15. "Yesterday's" 23:45 - 23:59 and "Today's" 00:00 - 00:15, and then merged.

 

For some reason, the Heroku app has been crashing at 23:00 or 11 PM UTC many nights consecutively, and it seems to be due to an "error 500 / Internal Server Error" from the Fitbit WebAPI. I should implement better error management, I know  🙂 Fortunately the web app restarts after a while.


Sending the indentical request later (see example below) returns data normally, but the request fails when sent at 11 PM UTC.

 

'https://api.fitbit.com/1/user/XXXXXX/activities/heart/date/2022-08-20/1d/5min/time/22:30/23:00.json?...'.

 

Looking back in the logs, there have been random error 500 events earlier at various timepoints, usually during night hours. But now it has happenend regularly at 11 PM. Any idea ?

Thanks ! 

Best Answer
0 Votes
3 REPLIES 3

Hi @lsandini 

 

I'm going to send you a private message to collect some information from you.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Looking through our logs, the 500 errors seemed to be coming from activity endpoints not heart rate.  The activities endpoints were using the "5min" detail which is supported for heart rate, not activity.   I believe the error is caused by bad syntax..  

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Thank you Gordon for your patience, time and effort.

 

Strangely the error disappeared on the 27.8 --> 31.8 and reappeared since then. No syntax change on our side.

 

We modified the code, requesting 1min-detail data for both activity and heartrate endpoints, and delayed the calls so that the requested period ends at least 5 min before the request timepoint. Same error last night at 11 PM UTC.

 

I guess I'll have to handle the 500 so that my app doesn't crash, and check when is the next successful call.

 

Best Answer
0 Votes