Skip to content

[@googleapis/health] Google Health SDK/HTTPs cannot create subscriber #3936

Description

@chameldoyon

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:

Image
{
  "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.

  1. Create/configure your google project to enable Health API.
  2. Create a service account with "Health API Editor" role
  3. Create a key and download it.
  4. Set your GOOGLE_APPLICATION_CREDENTIALS config in your .env
  5. 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):
Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions