Method: users.getIdentity

Gets the user's identity.

It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating clients to map identifiers between the two systems.

HTTP request

GET https://health.googleapis.com/v4/{name=users/*/identity}

The URL uses gRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the service error catalog

Path parameters

Parameters
name

string

Required. The resource name of the Identity. Format: users/me/identity It takes the form users/{user}/identity.

Request body

The request body must be empty.

Response body

Represents details about the Google user's identity.

If successful, the response body contains data with the following structure:

JSON representation
{
  "name": string,
  "legacyUserId": string,
  "healthUserId": string
}
Fields
name

string

Identifier. The resource name of this Identity resource. Format: users/me/identity

legacyUserId

string

Output only. The legacy Fitbit User identifier. This is the Fitbit ID used in the legacy Fitbit APIs (v1-v3). It can be referenced by clients migrating from the legacy Fitbit APIs to map their existing identifiers to the new Google user ID.

It must not be used for any other purpose. It is not of any use for new clients using only the Google Health APIs.

Valid values are strings of 1-63 characters, and valid characters are lowercase and uppercase letters, numbers, and hyphens.

healthUserId

string

Output only. The Google User Identifier in the Google Health APIs. It matches the {user} resource ID segment in the resource name paths, e.g. users/{user}/dataTypes/steps.

Valid values are strings of 1-63 characters, and valid characters are lowercase and uppercase letters, numbers, and hyphens.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/googlehealth.profile
  • https://www.googleapis.com/auth/googlehealth.profile.readonly
  • https://www.googleapis.com/auth/googlehealth.settings
  • https://www.googleapis.com/auth/googlehealth.settings.readonly
  • https://www.googleapis.com/auth/googlehealth.activity_and_fitness
  • https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly
  • https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements
  • https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly
  • https://www.googleapis.com/auth/googlehealth.location
  • https://www.googleapis.com/auth/googlehealth.location.readonly
  • https://www.googleapis.com/auth/googlehealth.nutrition
  • https://www.googleapis.com/auth/googlehealth.nutrition.readonly
  • https://www.googleapis.com/auth/googlehealth.sleep
  • https://www.googleapis.com/auth/googlehealth.sleep.readonly

For more information, see the OAuth 2.0 Overview.