PubSub Tokens
Create PubSub token
Generate a PubSub Token to be used to authenticate clients to the PubSub Service.
Permissions
The API token used to authenticate must have the following scope(s) enabled to make a successful request: PubSub.
Learn more about API scopes.
post/api/pubsub/tokens
Request body
Example request
{
"ttl": 15,
"channels": {
"channela": {
"read": true,
"write": false
},
"channelb": {
"read": true
}
},
"member_id": "John Doe",
"state": {
"display_name": "Joe",
"an_array": [
"foo",
"bar",
"baz"
]
}
}Response
The request has succeeded.
Example response
{
"token": "eyJ0eXAiOiJWUlQiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2MjIxMjAxMjMsI...wMCwicnNlIjo5MDB9-BqG-DqC5LhpsdMWEFjhVkTBpQ"
}