curl -X POST \
-H "Authorization: ApiKey cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
https://api.quickblox.com/users/123/tokens
{
"token": "c56f382b402fb482086db956064592d3cd012bba",
"expires_at": "2023-09-01T14:55:56Z"
}
// Invalid Authorization header
{
"errors": {
"base": [
"Authorization header is invalid."
]
}
}
// Invalid API Key
{
"errors": {
"base": [
"Api Key is not found."
]
}
}
{
"errors": {
"base": [
"User is not found."
]
}
}
Users
Create Token with API key
Creates user session for a user using an API key
POST
/
users
/
{user_id}
/
tokens
curl -X POST \
-H "Authorization: ApiKey cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
https://api.quickblox.com/users/123/tokens
{
"token": "c56f382b402fb482086db956064592d3cd012bba",
"expires_at": "2023-09-01T14:55:56Z"
}
// Invalid Authorization header
{
"errors": {
"base": [
"Authorization header is invalid."
]
}
}
// Invalid API Key
{
"errors": {
"base": [
"Api Key is not found."
]
}
}
{
"errors": {
"base": [
"User is not found."
]
}
}
You can’t use the QB token in this request. It will be ignored if you pass the QB-Token header in the request.
Path Parameters
integer
required
ID of the user. Generated automatically by the server after user creation.
Headers
string
default:"ApiKey {your_api_key}"
required
API key from Dashboard. Expected format:
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.Responses
curl -X POST \
-H "Authorization: ApiKey cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
https://api.quickblox.com/users/123/tokens
{
"token": "c56f382b402fb482086db956064592d3cd012bba",
"expires_at": "2023-09-01T14:55:56Z"
}
// Invalid Authorization header
{
"errors": {
"base": [
"Authorization header is invalid."
]
}
}
// Invalid API Key
{
"errors": {
"base": [
"Api Key is not found."
]
}
}
{
"errors": {
"base": [
"User is not found."
]
}
}
Was this page helpful?