CreateParticipantToken
Creates an additional token for a specified stage. This can be done after stage creation or when tokens expire. Tokens always are scoped to the stage for which they are created.
Encryption keys are owned by Amazon IVS and never used directly by your application.
Request Syntax
POST /CreateParticipantToken HTTP/1.1
Content-type: application/json
{
"attributes": {
"string
" : "string
"
},
"capabilities": [ "string
" ],
"duration": number
,
"stageArn": "string
",
"userId": "string
"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- attributes
-
Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive information.
Type: String to string map
Required: No
- capabilities
-
Set of capabilities that the user is allowed to perform in the stage. Default:
PUBLISH, SUBSCRIBE
.Type: Array of strings
Array Members: Minimum number of 0 items. Maximum number of 2 items.
Valid Values:
PUBLISH | SUBSCRIBE
Required: No
- duration
-
Duration (in minutes), after which the token expires. Default: 720 (12 hours).
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 20160.
Required: No
- stageArn
-
ARN of the stage to which this token is scoped.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
arn:aws:ivs:[a-z0-9-]+:[0-9]+:stage/[a-zA-Z0-9-]+
Required: Yes
- userId
-
Name that can be specified to help identify the token. This can be any UTF-8 encoded text. This field is exposed to all stage participants and should not be used for personally identifying, confidential, or sensitive information.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 128.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"participantToken": {
"attributes": {
"string" : "string"
},
"capabilities": [ "string" ],
"duration": number,
"expirationTime": "string",
"participantId": "string",
"token": "string",
"userId": "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.
- participantToken
-
The participant token that was created.
Type: ParticipantToken object
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
HTTP Status Code: 403
- PendingVerification
-
HTTP Status Code: 403
- ResourceNotFoundException
-
HTTP Status Code: 404
- ServiceQuotaExceededException
-
HTTP Status Code: 402
- ValidationException
-
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: