Account

Get OAuth2 access token

Get the active OAuth2 access token for an account. NB! This endpoint is disabled by default and needs activation on the Service configuration page.

get/v1/account/{account}/oauth-token

Request

  • Base URL: https://your-emailengine-host
  • URL: https://your-emailengine-host/v1/account/{account}/oauth-token
  • Auth: HTTP bearer

Path parameters

accountstring required

Unique identifier for the email account

Example:user123

Headers

x-ee-timeoutinteger

Request timeout in milliseconds. Raises the command timeout above the EENGINE_TIMEOUT default for a long-running request; a value below the default has no effect

Example:30000

Response

Returns a valid OAuth2 access token for the account, refreshing it first if it had expired.

accountstring required

Unique identifier for the email account

userstring required

Username

accessTokenstring

Access Token. Can be missing if the external authentication server provided password-based credentials

provider'gmail' | 'gmailService' | 'outlook' | 'outlookService' | 'mailRu' required

OAuth2 provider

appstring

OAuth2 application ID

registeredScopesstring[]

OAuth2 scopes registered for this account

expiresstring date-time

When the access token expires

cachedboolean

Whether the token was returned from cache or was freshly renewed

Example response

{
  "account": "user123",
  "user": "user@example.com",
  "accessToken": "aGVsbG8gd29ybGQ=",
  "provider": "gmail",
  "app": "AAABhaBPHscAAAAH",
  "registeredScopes": [
    "https://mail.google.com/"
  ],
  "expires": "2021-03-22T13:13:31.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.