Communication Identity - Issue Access Token

Issue a new token for an identity.

POST {endpoint}/identities/{id}/:issueAccessToken?api-version=2023-10-01

URI Parameters

Name In Required Type Description
endpoint
path True

string

The communication resource, for example https://my-resource.communication.azure.com

id
path True

string

Identifier of the identity to issue token for.

api-version
query True

string

Version of API to invoke.

Request Body

Name Required Type Description
scopes True

CommunicationIdentityTokenScope[]

List of scopes attached to the token.

expiresInMinutes

integer

Optional custom validity period of the token within [60,1440] minutes range. If not provided, the default value of 1440 minutes (24 hours) will be used.

Responses

Name Type Description
200 OK

CommunicationIdentityAccessToken

Success

Other Status Codes

CommunicationErrorResponse

Error

Examples

Issue an access token. Optionally specify a custom expiration time within the [60-1440] minutes range. In case an expiration time is not specified, the default value of 1440 minutes (24 hours) will be used.

Sample Request

POST https://my-resource.communication.azure.com/identities/8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081/:issueAccessToken?api-version=2023-10-01

{
  "scopes": [
    "chat",
    "voip",
    "chat.join",
    "chat.join.limited",
    "voip.join"
  ],
  "expiresInMinutes": 60
}

Sample Response

{
  "token": "token",
  "expiresOn": "2023-10-10T21:39:39.3244584+00:00"
}

Definitions

Name Description
CommunicationError

The Communication Services error.

CommunicationErrorResponse

The Communication Services error.

CommunicationIdentityAccessToken

An access token.

CommunicationIdentityAccessTokenRequest
CommunicationIdentityTokenScope

List of scopes for an access token.

CommunicationError

The Communication Services error.

Name Type Description
code

string

The error code.

details

CommunicationError[]

Further details about specific errors that led to this error.

innererror

CommunicationError

The inner error if any.

message

string

The error message.

target

string

The error target.

CommunicationErrorResponse

The Communication Services error.

Name Type Description
error

CommunicationError

The Communication Services error.

CommunicationIdentityAccessToken

An access token.

Name Type Description
expiresOn

string

The expiry time of the token.

token

string

The access token issued for the identity.

CommunicationIdentityAccessTokenRequest

Name Type Default Value Description
expiresInMinutes

integer

1440

Optional custom validity period of the token within [60,1440] minutes range. If not provided, the default value of 1440 minutes (24 hours) will be used.

scopes

CommunicationIdentityTokenScope[]

List of scopes attached to the token.

CommunicationIdentityTokenScope

List of scopes for an access token.

Name Type Description
chat

string

Use this for full access to Chat APIs.

chat.join

string

Access to Chat APIs but without the authorization to create, delete or update chat threads.

chat.join.limited

string

A more limited version of chat.join that doesn't allow to add or remove participants. Use this scope when the token bearer is not fully trusted, for example in guest scenarios.

voip

string

Use this for full access to Calling APIs.

voip.join

string

Access to Calling APIs but without the authorization to start new calls.