AmplifyUIBuilder / Client / exchange_code_for_token

exchange_code_for_token#

AmplifyUIBuilder.Client.exchange_code_for_token(**kwargs)#

Exchanges an access code for a token.

See also: AWS API Documentation

Request Syntax

response = client.exchange_code_for_token(
    provider='figma',
    request={
        'code': 'string',
        'redirectUri': 'string',
        'clientId': 'string'
    }
)
Parameters:
  • provider (string) –

    [REQUIRED]

    The third-party provider for the token. The only valid value is figma.

  • request (dict) –

    [REQUIRED]

    Describes the configuration of the request.

    • code (string) – [REQUIRED]

      The access code to send in the request.

    • redirectUri (string) – [REQUIRED]

      The location of the application that will receive the access code.

    • clientId (string) –

      The ID of the client to request the token from.

Return type:

dict

Returns:

Response Syntax

{
    'accessToken': 'string',
    'expiresIn': 123,
    'refreshToken': 'string'
}

Response Structure

  • (dict) –

    • accessToken (string) –

      The access token.

    • expiresIn (integer) –

      The date and time when the new access token expires.

    • refreshToken (string) –

      The token to use to refresh a previously issued access token that might have expired.

Exceptions

  • AmplifyUIBuilder.Client.exceptions.InvalidParameterException