v2

latestOpenAPI 3.0.1raw.githubusercontent.com2024-06-24221444.3 KB
Authentication

Request an access token

This is the means by which clients obtain access tokens to use the service. You can see how to construct an Ably TokenRequest in the Ably TokenRequest spec documentation, although we recommend you use an Ably SDK rather to create a TokenRequest, as the construction of a TokenRequest is complex. The resulting token response object contains the token properties as defined in Ably TokenRequest spec. Authentication is not required if using a Signed TokenRequest.

post/keys/{keyName}/requestToken

Path parameters

keyNamestring required

The key name comprises of the app ID and key ID of an API key.

Request body

OR

Example request

{
  "keyName": "xVLyHw.LMJZxw",
  "capability": {
    "channel1": [
      "publish",
      "subscribe"
    ]
  }
}

Response

OK

tokenstring

The Ably Token.

keyNamestring

Name of the key used to create the token

issuedinteger

Timestamp of token creation.

expiresinteger

Timestamp of token expiration.

capabilitystring

Regular expression representation of the capabilities of the token.