Google fit permission problems












0















I would like to get some technical help with the google fit rest Rest API.



I am making an app that requires access to the location information and as a response for my request I am getting this json.



{
"access_token": "ya29.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"scope": "https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.location.write https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.body.read",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "1/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}


So using the access_token, I made the following request and it works



https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate


Request Body:



{
"startTimeMillis":1543682285000,
"endTimeMillis":1543941485000,
"aggregateBy: [
{
"dataSourceId":"derived:com.google.calories.expended:com.google.android.gms:merge_calories_expended",
"dataTypeName":"com.google.calories.expended"
}
],"bucketByTime":{"durationMillis":259200000}
}


And I do get a correct response



but when done with the following body (dataSourceId and dataTypeName changed)



{
"startTimeMillis":1543682283000,
"endTimeMillis":1543941483000,
"aggregateBy":[
{
"dataSourceId":"derived:com.google.location.sample:com.google.android.gms:merge_location_samples",
"dataTypeName":"com.google.location.sample"}
],"bucketByTime":{"durationMillis":259200000}
}


I got



{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "No permission to read data for this private data source."
}
],
"code": 403,
"message": "No permission to read data for this private data source."
}
}


Also tried using all the fitness scopes(Read and Write):



 "scope": "https://www.googleapis.com/auth/fitness.activity.write
https://www.googleapis.com/auth/fitness.blood_pressure.read
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.reproductive_health.write
https://www.googleapis.com/auth/fitness.activity.read
https://www.googleapis.com/auth/fitness.reproductive_health.read
https://www.googleapis.com/auth/fitness.nutrition.write
https://www.googleapis.com/auth/fitness.body_temperature.write
https://www.googleapis.com/auth/fitness.body_temperature.read
https://www.googleapis.com/auth/fitness.nutrition.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.write
https://www.googleapis.com/auth/fitness.body.write
https://www.googleapis.com/auth/fitness.body.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.read
https://www.googleapis.com/auth/fitness.blood_glucose.write
https://www.googleapis.com/auth/fitness.location.write
https://www.googleapis.com/auth/fitness.location.read
https://www.googleapis.com/auth/fitness.blood_glucose.read"









share|improve this question

























  • From the error that you have shared, it is most likely that the you are not entitled or verified to access the data source. Have you also tried to clear any proxy? Also, have you tried visiting the documentation for Wear OS by Android?

    – MαπμQμαπkγVπ.0
    Dec 5 '18 at 11:11
















0















I would like to get some technical help with the google fit rest Rest API.



I am making an app that requires access to the location information and as a response for my request I am getting this json.



{
"access_token": "ya29.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"scope": "https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.location.write https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.body.read",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "1/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}


So using the access_token, I made the following request and it works



https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate


Request Body:



{
"startTimeMillis":1543682285000,
"endTimeMillis":1543941485000,
"aggregateBy: [
{
"dataSourceId":"derived:com.google.calories.expended:com.google.android.gms:merge_calories_expended",
"dataTypeName":"com.google.calories.expended"
}
],"bucketByTime":{"durationMillis":259200000}
}


And I do get a correct response



but when done with the following body (dataSourceId and dataTypeName changed)



{
"startTimeMillis":1543682283000,
"endTimeMillis":1543941483000,
"aggregateBy":[
{
"dataSourceId":"derived:com.google.location.sample:com.google.android.gms:merge_location_samples",
"dataTypeName":"com.google.location.sample"}
],"bucketByTime":{"durationMillis":259200000}
}


I got



{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "No permission to read data for this private data source."
}
],
"code": 403,
"message": "No permission to read data for this private data source."
}
}


Also tried using all the fitness scopes(Read and Write):



 "scope": "https://www.googleapis.com/auth/fitness.activity.write
https://www.googleapis.com/auth/fitness.blood_pressure.read
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.reproductive_health.write
https://www.googleapis.com/auth/fitness.activity.read
https://www.googleapis.com/auth/fitness.reproductive_health.read
https://www.googleapis.com/auth/fitness.nutrition.write
https://www.googleapis.com/auth/fitness.body_temperature.write
https://www.googleapis.com/auth/fitness.body_temperature.read
https://www.googleapis.com/auth/fitness.nutrition.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.write
https://www.googleapis.com/auth/fitness.body.write
https://www.googleapis.com/auth/fitness.body.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.read
https://www.googleapis.com/auth/fitness.blood_glucose.write
https://www.googleapis.com/auth/fitness.location.write
https://www.googleapis.com/auth/fitness.location.read
https://www.googleapis.com/auth/fitness.blood_glucose.read"









share|improve this question

























  • From the error that you have shared, it is most likely that the you are not entitled or verified to access the data source. Have you also tried to clear any proxy? Also, have you tried visiting the documentation for Wear OS by Android?

    – MαπμQμαπkγVπ.0
    Dec 5 '18 at 11:11














0












0








0








I would like to get some technical help with the google fit rest Rest API.



I am making an app that requires access to the location information and as a response for my request I am getting this json.



{
"access_token": "ya29.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"scope": "https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.location.write https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.body.read",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "1/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}


So using the access_token, I made the following request and it works



https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate


Request Body:



{
"startTimeMillis":1543682285000,
"endTimeMillis":1543941485000,
"aggregateBy: [
{
"dataSourceId":"derived:com.google.calories.expended:com.google.android.gms:merge_calories_expended",
"dataTypeName":"com.google.calories.expended"
}
],"bucketByTime":{"durationMillis":259200000}
}


And I do get a correct response



but when done with the following body (dataSourceId and dataTypeName changed)



{
"startTimeMillis":1543682283000,
"endTimeMillis":1543941483000,
"aggregateBy":[
{
"dataSourceId":"derived:com.google.location.sample:com.google.android.gms:merge_location_samples",
"dataTypeName":"com.google.location.sample"}
],"bucketByTime":{"durationMillis":259200000}
}


I got



{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "No permission to read data for this private data source."
}
],
"code": 403,
"message": "No permission to read data for this private data source."
}
}


Also tried using all the fitness scopes(Read and Write):



 "scope": "https://www.googleapis.com/auth/fitness.activity.write
https://www.googleapis.com/auth/fitness.blood_pressure.read
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.reproductive_health.write
https://www.googleapis.com/auth/fitness.activity.read
https://www.googleapis.com/auth/fitness.reproductive_health.read
https://www.googleapis.com/auth/fitness.nutrition.write
https://www.googleapis.com/auth/fitness.body_temperature.write
https://www.googleapis.com/auth/fitness.body_temperature.read
https://www.googleapis.com/auth/fitness.nutrition.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.write
https://www.googleapis.com/auth/fitness.body.write
https://www.googleapis.com/auth/fitness.body.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.read
https://www.googleapis.com/auth/fitness.blood_glucose.write
https://www.googleapis.com/auth/fitness.location.write
https://www.googleapis.com/auth/fitness.location.read
https://www.googleapis.com/auth/fitness.blood_glucose.read"









share|improve this question
















I would like to get some technical help with the google fit rest Rest API.



I am making an app that requires access to the location information and as a response for my request I am getting this json.



{
"access_token": "ya29.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"scope": "https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.location.write https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.body.read",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "1/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}


So using the access_token, I made the following request and it works



https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate


Request Body:



{
"startTimeMillis":1543682285000,
"endTimeMillis":1543941485000,
"aggregateBy: [
{
"dataSourceId":"derived:com.google.calories.expended:com.google.android.gms:merge_calories_expended",
"dataTypeName":"com.google.calories.expended"
}
],"bucketByTime":{"durationMillis":259200000}
}


And I do get a correct response



but when done with the following body (dataSourceId and dataTypeName changed)



{
"startTimeMillis":1543682283000,
"endTimeMillis":1543941483000,
"aggregateBy":[
{
"dataSourceId":"derived:com.google.location.sample:com.google.android.gms:merge_location_samples",
"dataTypeName":"com.google.location.sample"}
],"bucketByTime":{"durationMillis":259200000}
}


I got



{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "No permission to read data for this private data source."
}
],
"code": 403,
"message": "No permission to read data for this private data source."
}
}


Also tried using all the fitness scopes(Read and Write):



 "scope": "https://www.googleapis.com/auth/fitness.activity.write
https://www.googleapis.com/auth/fitness.blood_pressure.read
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.reproductive_health.write
https://www.googleapis.com/auth/fitness.activity.read
https://www.googleapis.com/auth/fitness.reproductive_health.read
https://www.googleapis.com/auth/fitness.nutrition.write
https://www.googleapis.com/auth/fitness.body_temperature.write
https://www.googleapis.com/auth/fitness.body_temperature.read
https://www.googleapis.com/auth/fitness.nutrition.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.write
https://www.googleapis.com/auth/fitness.body.write
https://www.googleapis.com/auth/fitness.body.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.read
https://www.googleapis.com/auth/fitness.blood_glucose.write
https://www.googleapis.com/auth/fitness.location.write
https://www.googleapis.com/auth/fitness.location.read
https://www.googleapis.com/auth/fitness.blood_glucose.read"






google-fit google-fit-sdk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 '18 at 9:22









MαπμQμαπkγVπ.0

2,2921515




2,2921515










asked Dec 4 '18 at 17:11









Ricardo Garza V.Ricardo Garza V.

8001721




8001721













  • From the error that you have shared, it is most likely that the you are not entitled or verified to access the data source. Have you also tried to clear any proxy? Also, have you tried visiting the documentation for Wear OS by Android?

    – MαπμQμαπkγVπ.0
    Dec 5 '18 at 11:11



















  • From the error that you have shared, it is most likely that the you are not entitled or verified to access the data source. Have you also tried to clear any proxy? Also, have you tried visiting the documentation for Wear OS by Android?

    – MαπμQμαπkγVπ.0
    Dec 5 '18 at 11:11

















From the error that you have shared, it is most likely that the you are not entitled or verified to access the data source. Have you also tried to clear any proxy? Also, have you tried visiting the documentation for Wear OS by Android?

– MαπμQμαπkγVπ.0
Dec 5 '18 at 11:11





From the error that you have shared, it is most likely that the you are not entitled or verified to access the data source. Have you also tried to clear any proxy? Also, have you tried visiting the documentation for Wear OS by Android?

– MαπμQμαπkγVπ.0
Dec 5 '18 at 11:11












1 Answer
1






active

oldest

votes


















0














As part of Google's ongoing efforts to improve data privacy and security, we are updating the Google Fit API. In November, we made changes to the way location samples can be read through the Fit API for Android and the Fit REST API.



Going forward, applications will only be able to read location samples that they have written to the platform. As the merge_location_samples stream is written internally by the Fit platform, it is no longer accessible to third-party developers.



If your application requires access to location, we encourage you to use the standard means for accessing location on a user's device (see here).






share|improve this answer


























  • Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

    – artBCode
    Mar 7 at 12:50






  • 1





    @artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

    – Andy Turner
    Mar 7 at 13:15











  • Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

    – artBCode
    Mar 7 at 14:27













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53618213%2fgoogle-fit-permission-problems%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














As part of Google's ongoing efforts to improve data privacy and security, we are updating the Google Fit API. In November, we made changes to the way location samples can be read through the Fit API for Android and the Fit REST API.



Going forward, applications will only be able to read location samples that they have written to the platform. As the merge_location_samples stream is written internally by the Fit platform, it is no longer accessible to third-party developers.



If your application requires access to location, we encourage you to use the standard means for accessing location on a user's device (see here).






share|improve this answer


























  • Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

    – artBCode
    Mar 7 at 12:50






  • 1





    @artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

    – Andy Turner
    Mar 7 at 13:15











  • Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

    – artBCode
    Mar 7 at 14:27


















0














As part of Google's ongoing efforts to improve data privacy and security, we are updating the Google Fit API. In November, we made changes to the way location samples can be read through the Fit API for Android and the Fit REST API.



Going forward, applications will only be able to read location samples that they have written to the platform. As the merge_location_samples stream is written internally by the Fit platform, it is no longer accessible to third-party developers.



If your application requires access to location, we encourage you to use the standard means for accessing location on a user's device (see here).






share|improve this answer


























  • Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

    – artBCode
    Mar 7 at 12:50






  • 1





    @artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

    – Andy Turner
    Mar 7 at 13:15











  • Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

    – artBCode
    Mar 7 at 14:27
















0












0








0







As part of Google's ongoing efforts to improve data privacy and security, we are updating the Google Fit API. In November, we made changes to the way location samples can be read through the Fit API for Android and the Fit REST API.



Going forward, applications will only be able to read location samples that they have written to the platform. As the merge_location_samples stream is written internally by the Fit platform, it is no longer accessible to third-party developers.



If your application requires access to location, we encourage you to use the standard means for accessing location on a user's device (see here).






share|improve this answer















As part of Google's ongoing efforts to improve data privacy and security, we are updating the Google Fit API. In November, we made changes to the way location samples can be read through the Fit API for Android and the Fit REST API.



Going forward, applications will only be able to read location samples that they have written to the platform. As the merge_location_samples stream is written internally by the Fit platform, it is no longer accessible to third-party developers.



If your application requires access to location, we encourage you to use the standard means for accessing location on a user's device (see here).







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 2 at 9:56

























answered Jan 2 at 9:51









Andy TurnerAndy Turner

83.8k983142




83.8k983142













  • Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

    – artBCode
    Mar 7 at 12:50






  • 1





    @artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

    – Andy Turner
    Mar 7 at 13:15











  • Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

    – artBCode
    Mar 7 at 14:27





















  • Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

    – artBCode
    Mar 7 at 12:50






  • 1





    @artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

    – Andy Turner
    Mar 7 at 13:15











  • Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

    – artBCode
    Mar 7 at 14:27



















Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

– artBCode
Mar 7 at 12:50





Is that true for all types of internal Fit platform data or only for location? I'm particularly interested in body sensors data availability.

– artBCode
Mar 7 at 12:50




1




1





@artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

– Andy Turner
Mar 7 at 13:15





@artBCode body sensor types remain public. You should be able to read them with the appropriate OAuth scope.

– Andy Turner
Mar 7 at 13:15













Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

– artBCode
Mar 7 at 14:27







Thank you for your response, Andy. If I may: I'm building an app using the Google Fit API where I'm trying to get live sensor data. After getting the proper ID Client the app works fine on android phones. When I try to connect to the Sensors API on Wear OS 2.x I get the following error: "com.google.android.gms.common.api.ApiException: 17: API: Fitness.SENSORS_CLIENT is not available on this device." Do you think it might be permission related(WearOS specific)? The app even shows up as connected in the Google Fit app.

– artBCode
Mar 7 at 14:27






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53618213%2fgoogle-fit-permission-problems%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith