Account Linking Schemas (Skill Management API)

The accountLinkingRequest structure is a JSON representation of the account linking information shown on the Build > Account Linking section of the developer console.

You can create and get account linking information by using the create-account-linking and get-account-linking subcommands of the ask api command.

See also: Alexa Skills Kit Command Line Interface and Alexa Skill Management API Overview

Account Linking Request

Field Description Type
type Specifies the OAuth authorization grant type. Use AUTH_CODE or IMPLICIT. NOTE: You must use AUTH_CODE with smart home skills. String
authorizationUrl Authorization URI String
domains A list of additional domains that your login page fetches content from. You can specify up to 15 domains. Array of String
clientId Identifier your login page uses to recognize that the request came from your skill. String
scopes Indicates the access that you need for the customer account such as user_id. This field is required for smart home skills. You can specify up to 15 scopes. Array of String
accessTokenUrl URI for requesting authorization tokens. Required only when AUTH_CODE is specified for type. String
clientSecret A credential you provide that lets the Alexa service authenticate with the Access Token URI. This is combined with clientId to identify the request as coming from Alexa. String
accessTokenScheme The type of authentication used such as HTTP_BASIC, or REQUEST_BODY_CREDENTIALS. Required only when AUTH_CODE is specified. String
defaultTokenExpirationInSeconds Optional. The time in seconds for which the access token is valid. This value is used if the OAuth client does not return expires_in. If the OAuth client returns expires_in, the value provided by the OAuth client is used instead. Only applicable if type is AUTH_CODE. Integer

Sample Account Linking Request

{
  "accountLinkingRequest": {
    "type": "AUTH_CODE",
    "authorizationUrl": "string",
    "domains": [
      "string"
    ],
    "clientId": "string",
    "scopes": [
      "string"
    ],
    "accessTokenUrl": "string",
    "clientSecret": "string",
    "accessTokenScheme": "HTTP_BASIC",
    "defaultTokenExpirationInSeconds": 3600
  }
}

Redirect URLs After Customer Account Authenticated

The redirect URL is the URL to which your service redirects the customer after the customer has been authenticated. This redirect URL is referenced with the redirect_uri field.

Because the redirect_uri field has constant, pre-determined values, it is not part of the account linking schema, and thus cannot be parsed from user input.

For an authorization code grant, such as used for all smart home skills and some custom skills, the format of the redirect_uri value is as follows:

{baseUrl}/api/skill/link/{vendorId}

For an implicit grant, which is used for some custom skills, the format of the redirect_uri value is as follows:

{baseURL}/spa/skill/account-linking-status.html?vendorId={vendorId}

The list of valid HTTPS redirection endpoints, which are possible values for baseUrl, include the following:

  • https://pitangui.amazon.com
  • https://layla.amazon.com
  • https://alexa.amazon.co.jp

See Authorization Grant Types for Custom Skills for more information on the difference between authorization code grant and implicit grant.

See Understand Account Linking for an overview of account linking.