Loading...

Get Token Pair

Description

This API generates a token pair for a Datastream channel. The token pair is required to establish a WebSocket connection for any specific client or application to subscribe to the channel.

Note: app_user_id is the unique identifier of an application user in your Catalyst project. You can obtain the value of app_user_id from Catalyst Authentication, which represents who is subscribing to the Data Streams channel. Check out this page for more details.

Request Details

Request URL

POST

{api-domain}/baas/v1/project/{project_id}/datastreams/channel/{channel_id}/tokenpair

copy

api-domain
URL
The DC-specific domain used to access Catalyst APIs

project_id
Numerical
The unique ID of the Catalyst project

channel_id
Numerical
The unique ID of the Datastream channel


Request Headers

Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Request Body

app_user_id Numerical
mandatory
The unique ID of the application user for whom the token pair is generated

Scope

ZohoCatalyst.datastreams.connections.token.CREATE

Response Details

On successful execution, the response returns a token pair that can be used by the specified application user to establish a WebSocket connection and subscribe to the Datastream channel.

Sample Request
copy

curl -X POST
https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel/20084000000662015/tokenpair
-H “Authorization: Zoho-oauthtoken 1000.06adcc79fa822856dc0668e88d297d45.252b0f4d750669be5965252623d40004”
-H “CATALYST-ORG: 89773766”
-H “Environment: Development”
-H “Content-Type: application/json”
-d ‘{ “app_user_id”: 20084000000888047 }’