Read BloodPressure and BloodGlucose dataSource from google api playground

If I go to the google api playground, follow these steps:

Step 1. Selection and authorization of the API. I choose two areas

I have to read the blood glucose and pressure from the user.

I select the google user and allow the application to read the data.

Step 2: Exchange Authorization Code for Tokens. I use authorization token for access token and update.

Step 3: Configure the API request. From the list of possible operations that I select DataSources UsersLists, all data sources that are visible to the developer using the areas provided by OAuth. The list is not exhaustive; the user may have private data sources that are visible only to other developers or calls using other areas. Request: GET https://www.googleapis.com/fitness/v1/users/ {userId} / dataSources

I am changing {userId} with me, and I suppose to get a data source to read blood glucose and blood pressure, but what I get is an empty array. { "data source": [] }

I need to check the readings of such values ​​(pressure and glucose). What steps should I go on the google playground to achieve these 2 readings?

Thanks in advance

+8
oauth2-playground google-fit
source share
1 answer

To obtain blood pressure and glucose data, you must first create this data. You see in get api that your data source is empty. Here's what you can do to create and get your blood pressure:

Note that in the above code, 1518561964000000000 is an era in nanoseconds, and you need to change it to the current time. You can do the same for glucose data using an app that measures your blood glucose :)

+1
source share

All Articles