Access Tokens
Whenever a user login using Channelize.io Login API, the user receives an access token. This access token is used as an authentication token to perform any action on Channelize.io.
Apart from Channelize.io Login API, Channelize.io also provides you an alternative method to create the access token for any user. You can use this method on your backend application using Channelize.io Private Key. In this method, You only need to provide the user ID for which you want to create the access token.
Create an Access Token
Creates an access token for the given user.
POST https://api.channelize.io/v2/users/create_access_token
Body Params
This table lists all possible parameters body of this API request supports.
Name | Type | Required | Description |
---|---|---|---|
userId | string | yes | The ID of the user for which you want to create the access token. |
Response
Status Code : 201
{
"id": "lqdpzHwKAApexFiL8jlTFxcFppikI7utqInG8qlFdtWqbbFRJX7H5XDXvvGyhhuP",
"ttl": 1209600,
"created": "2020-10-15T12:27:41.508Z",
"userId": "5c4c47d1-8c2a-4b8e-841d-8b479235a170",
"user": {
"id": "5c4c47d1-8c2a-4b8e-841d-8b479235a170",
"displayName": "Sabrina Schmidt",
"language": "en",
"profileImageUrl": "http://placeimg.com/640/480",
"metaData": {},
"profileUrl": "http://delta.org",
"isOnline": true,
"visibility": true,
"notification": true,
"role": "user",
"isDeleted": false,
"isActive": true
}
}
Note: id in the response is the access token created for the given user. You can pass this access token to your front-end web/mobile application and use this access token to authenticate the API requests.