Search code examples
google-fitgoogle-fit-sdk

Google Fit REST API dataSource datasets return no Points


I'm trying to retrieve points from a dataSource dataset using the Google Fit REST API

As explained in another StackOverflow post I've first made this API call to get a list of dataSources:

https://www.googleapis.com/fitness/v1/users/me/dataSources

And then using the ID of a dataSource supplied in the response I make this query:

https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.distance.delta:com.google.android.gms:asus:Nexus 7:f0e3ca13:/datasets/000000-1419867599

Which according to the documentation should return a Users.dataSources.datasets resource that includes points. However this is all I get:

{
  "minStartTimeNs": "0", 
  "maxEndTimeNs": "1419867599", 
  "dataSourceId": "derived:com.google.distance.delta:com.google.android.gms:asus:Nexus 7:f0e3ca13:"
}

I've tried other dataSource ID's from the first API call and the result is the same. What am I doing wrong, how do I get dataPoints returned in the response ?


Solution

  • My solution is: $StartTime*1000000000;

    And convert in string using this function: http://php.net/manual/es/function.floatval.php#106367