:doc:`AmplifyUIBuilder <../../amplifyuibuilder>` / Client / exchange_code_for_token

***********************
exchange_code_for_token
***********************



.. py:method:: AmplifyUIBuilder.Client.exchange_code_for_token(**kwargs)

  

  .. note::

    

    This is for internal use.

    

   

  Amplify uses this action to exchange an access code for a token.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/amplifyuibuilder-2021-08-11/ExchangeCodeForToken>`_  


  **Request Syntax**
  ::

    response = client.exchange_code_for_token(
        provider='figma',
        request={
            'code': 'string',
            'redirectUri': 'string',
            'clientId': 'string'
        }
    )
    
  :type provider: string
  :param provider: **[REQUIRED]** 

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

    

  
  :type request: dict
  :param request: **[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.

      

    
  
  
  :rtype: 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**
  
  *   :py:class:`AmplifyUIBuilder.Client.exceptions.InvalidParameterException`

  