User Info & API Versioning

This page covers two advanced aspects of the OAuth 2.0 protocol supported by Health Gorilla:

  1. How to retrieve identity and role information about the authenticated user.
  2. How to specify a version of the Health Gorilla REST API during token requests.

Retrieve User Info

You can retrieve information about the authenticated user by calling the /oauth/userinfo endpoint with a valid access token.

Request

GET /oauth/userinfo?access_token=your_token

Example Response

{
  "uid": "e82806f23a131e02737779c1a9f7e365",
  "firstName": "John",
  "lastName": "Doe",
  "middleName": "Gorilla",
  "degree": "Ph. D. Psychology",
  "fullName": "John Gorilla Doe, Ph. D. Psychology",
  "locale": "en_US",
  "administrativeRole": "Provider",
  "npi": "1033100045",
  "email": "[email protected]",
  "emailVerified": true,
  "mobilePhone": "(555) 555-1234",
  "mobilePhoneVerified": false,
  "dob": "1970-01-01",
  "gender": "male",
  "organization": {
    "name": "Care Clinic",
    "phone": "(555) 555-5678",
    "fax": "(555) 555-9012",
    "faxVerified": false,
    "address": {
      "address1": "123 Health St",
      "address2": "Suite 200",
      "city": "Mountain View",
      "state": "CA",
      "zip": "94040",
      "country": "USA"
    }
  }
} 

The response includes administrative role, verified contact information, and organizational context.

API Version Targeting

You can explicitly request a specific version of Health Gorilla's REST API during token generation by including the hg_rest_api_version parameter.

Use Case

This is useful if you're building against a specific version of Health Gorilla's data model or want to ensure compatibility across staging and production environments.

How to Specify a Version

Include the following parameter when requesting a token:

hg_rest_api_version=10-01-2019 

Example Token Response (with version)

{
  "access_token": "access_token_value",
  "expires_in": 3600,
  "token_type": "Bearer",
  "refresh_token": "refresh_token_value",
  "scope": "user/.",
  "hg_rest_api_version": "10-01-2019"
} 

Invalid Version Example

If the version is not supported, you will receive an error like this:

{
  "error": "unsupported_api_version",
  "error_description": "The supplied Rest API version is not supported."
}