Please make sure you have searched for information in the following guides.
A screenshot that you have tested with "Try this API".
The "Try it!" button on the inner layer of the right sidebar did not do anything. I used the "API" on the outer layer of the right sidebar:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
The error was a 403, but it's using my account rather than the JSON key of my service account from the snippet.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/chameldoyon/e9266e6b419045732d0a168d03e59c4e
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
- Create/configure your google project to enable Health API.
- Create a service account with "Health API Editor" role
- Create a key and download it.
- Set your
GOOGLE_APPLICATION_CREDENTIALS config in your .env
- Run provided gist snippet
A clear and concise description of what the bug is, and what you expected to happen.
The subscriber should be created. Instead locally I have this error from the SDK:
Error: Request contains an invalid argument.
And this error via HTTPs:
{
error: {
code: 400,
message: 'Request contains an invalid argument.',
status: 'INVALID_ARGUMENT'
}
}
Also the logs in the service accounts show an empty payload (except for the subscriberId):

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
https://developers.google.com/health/reference/rest
https://health.googleapis.com/$discovery/rest?version=v4
https://developers.google.com/health/reference/rest/v4/projects.subscribers
https://developers.google.com/health/reference/rest/v4/projects.subscribers/create
Please make sure you have searched for information in the following guides.
A screenshot that you have tested with "Try this API".
The "Try it!" button on the inner layer of the right sidebar did not do anything. I used the "API" on the outer layer of the right sidebar:
The error was a 403, but it's using my account rather than the JSON key of my service account from the snippet.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/chameldoyon/e9266e6b419045732d0a168d03e59c4e
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
GOOGLE_APPLICATION_CREDENTIALSconfig in your.envA clear and concise description of what the bug is, and what you expected to happen.
The subscriber should be created. Instead locally I have this error from the SDK:
And this error via HTTPs:
Also the logs in the service accounts show an empty payload (except for the subscriberId):

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
https://developers.google.com/health/reference/rest
https://health.googleapis.com/$discovery/rest?version=v4
https://developers.google.com/health/reference/rest/v4/projects.subscribers
https://developers.google.com/health/reference/rest/v4/projects.subscribers/create