Issue a session token
This action issues a session token for user authentication. Session tokens provide an efficient stateless authentication method by not storing the tokens in the Sendbird database, and thus improving the server's performance. See access token vs. session token to learn more about authenticating users.
Note: The endpoint
/users/{user_id}
is deprecated. Use/users/{user_id}/token
for greater efficiency.
HTTP request
Parameters
The following table shows a parameter that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
user_id | string | Specifies the unique ID of the user. |
Request body
The following table shows a property of the HTTP request that this action supports.
Optional
Name | Type | Description |
---|---|---|
expires_at | long | Specifies the expiration time of the new session token in Unix milliseconds format. By default, the expiration time of a session token is seven days from the timestamp when the token was issued. |
Responses
If successful, this action returns a token of user in the response body.
List of response properties
Name | Type | Description |
---|---|---|
token | string | A user's session token generated by the |
Error
In the case of an error, an error object like below is returned. See the error codes section for more details.