exchangeCodeForToken method

Future<ExchangeCodeForTokenResponse> exchangeCodeForToken({
  1. required TokenProviders provider,
  2. required ExchangeCodeForTokenRequestBody request,
})
Amplify uses this action to exchange an access code for a token.

May throw InvalidParameterException.

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

Parameter request : Describes the configuration of the request.

Implementation

Future<ExchangeCodeForTokenResponse> exchangeCodeForToken({
  required TokenProviders provider,
  required ExchangeCodeForTokenRequestBody request,
}) async {
  final response = await _protocol.send(
    payload: request,
    method: 'POST',
    requestUri: '/tokens/${Uri.encodeComponent(provider.value)}',
    exceptionFnMap: _exceptionFns,
  );
  return ExchangeCodeForTokenResponse.fromJson(response);
}