View a markdown version of this page

CreateAuthCode - Amazon Connect Customer

CreateAuthCode

Creates an authorization code for the specified Connect Customer instance. The authorization code can be used to establish a session with scoped permissions defined by the specified scope parameters.

Request Syntax

POST /auth/code/InstanceId HTTP/1.1 Content-type: application/json { "MaxSessionDurationMinutes": number, "Scope": { "DomainName": "string", "EntityId": "string", "EntityType": "string", "SecurityProfileIds": [ "string" ] }, "SessionInactivityDurationMinutes": number }

URI Request Parameters

The request uses the following URI parameters.

InstanceId

The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

Request Body

The request accepts the following data in JSON format.

MaxSessionDurationMinutes

The maximum duration of the session, in minutes. Minimum value of 1440 (24 hours). Maximum value of 43200 (30 days). If no value is provided, the session will expire after 400 days.

Type: Integer

Valid Range: Minimum value of 1440. Maximum value of 43200.

Required: No

Scope

The scope for the authorization code. Defines the permissions and access boundaries for the session.

Type: AuthScope object

Required: Yes

SessionInactivityDurationMinutes

The duration of inactivity, in minutes, after which the session expires. Minimum value of 1440 (24 hours). Maximum value of 20160 (14 days).

Type: Integer

Valid Range: Minimum value of 0. Maximum value of 20160.

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "AuthCode": "string", "EntityId": "string", "EntityType": "string", "SessionId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

AuthCode

The authorization code to use for establishing a session.

Type: String

EntityId

The identifier of the entity associated with the authorization code.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: .*

EntityType

The type of entity associated with the authorization code.

Type: String

Valid Values: CUSTOMER_PROFILE

SessionId

The identifier of the session created with the authorization code.

Type: String

Length Constraints: Maximum length of 36.

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

InternalServiceException

Request processing failed because of an error or failure with the service.

Message

The message.

HTTP Status Code: 500

InvalidParameterException

One or more of the specified parameters are not valid.

Message

The message about the parameters.

HTTP Status Code: 400

InvalidRequestException

The request is not valid.

Message

The message about the request.

Reason

Reason why the request was invalid.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource was not found.

Message

The message about the resource.

HTTP Status Code: 404

ThrottlingException

The throttling limit has been exceeded.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: