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

Web API http request error

Hi,

 

I'm using Fitbit Web API in my Android app. Everything worked well. But, there have been request errors since I renew my token due to the expiration.

 

Following logs are the error. It seemed like an authorization problem, so I logged out and then logged in again. After that the problem was solved, but this happened again after a few hours. (I set the token expires_in one year.)

.setTokenExpiresIn(31536000L)

Is there anybody who have this issue? I need your advice. Thanks.

 

07-13 10:24:54.367 11914-13638/jordan.personicle W/System.err: java.io.FileNotFoundException: https://api.fitbit.com/1/user/-/activities/heart/date/today/1d/1min.json

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(Unknown Source:0)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at com.fitbit.fitbitcommon.network.BasicHttpRequest.execute(BasicHttpRequest.java:161)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at jordan.personicle.service.FitBitDataService.reqeustFitBitForTimely(FitBitDataService.java:98)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at jordan.personicle.service.FitBitDataService.onHandleIntent(FitBitDataService.java:86)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:68)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:105)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at android.os.Looper.loop(Looper.java:164)

07-13 10:24:54.368 11914-13638/jordan.personicle W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:65)

Best Answer
2 REPLIES 2

Any advice? It keeps showing me FileNotFoundException. 

 

If I log out and then log in again, it works well. But, it only takes a few hours even though I set

.setTokenExpiresIn(31536000L)

I worked well before, but suddenly happened. 

 

 

Best Answer

Hi @hyungiko2

 

I'm not sure why you are getting a FileNotFoundException.  But, I have seen a recent problem where using Implicit Grant Flow doesn't honor the specified token lifetime.  We're currently investigating this problem.

 

Gordon

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