Search code examples
google-fit

Google Fit Rest API - cant see any useful data


Hi just wondering how I get real data back from the following. I put in this into Oauth 2.0 playgournd:

https://www.googleapis.com/fitness/v1/users/me/dataSources/derive_step_cadence<-raw:com.google.step_count.cumulative:LGE:Nexus 5:bc5f1b97:Step Counter/datasets/8587796212108459505-8587784116108409439

And I get back this:

HTTP/1.1 200 OK Content-length: 202 X-xss-protection: 1; mode=block Content-location: https://www.googleapis.com/fitness/v1/users/me/dataSources/derive_step_cadence<-raw:com.google.step_count.cumulative:LGE:Nexus 5:bc5f1b97:Step Counter/datasets/8587796212108459505-8587784116108409439 X-content-type-options: nosniff Expires: Fri, 01 Jan 1990 00:00:00 GMT Vary: Origin,X-Origin Server: GSE Etag: "hLUJCvL5ZSSqXM3VrwyiV-fn_Cc/UTWu-5kuRnTemL1Tzb1qSZ4O9uk" Pragma: no-cache Cache-control: no-cache, no-store, max-age=0, must-revalidate Date: Fri, 06 Feb 2015 04:22:06 GMT X-frame-options: SAMEORIGIN Content-type: application/json; charset=UTF-8 { "minStartTimeNs": "8587784116108409439", "maxEndTimeNs": "8587796212108459505", "dataSourceId": "derive_step_cadence<-raw:com.google.step_count.cumulative:LGE:Nexus 5:bc5f1b97:Step Counter }

Not any useful data.

Am I doing something wrong?

thanks Russ


Solution

  • Be sure that timestamp that you provide at the end of the endpoint is in nanotime format.

    https://www.googleapis.com/fitness/v1/users/me/dataSources/derive_step_cadence<-raw:com.google.step_count.cumulative:LGE:Nexus 5:bc5f1b97:Step Counter/datasets/000000-1720845034000000000
    

    This solution works like a charm