Create User Access Token
POSThttps://api.powerapi.com/api/v1/organisations/me/users/:id/access_tokens
Allow admin
to generate access tokens for group_manager
and business manager
users from organisation
Request
Path Parameters
id stringrequired
- application/vnd.api+json
Bodyrequired
data objectrequired
Responses
- 201
Returns access token for given user
- application/vnd.api+json
- Schema
- Example (auto)
Schema
access_token stringrequired
Access token
Example:
412e4ce497df832272db63c627a00...
token_type stringrequired
Token type
Example:
Bearer
expires_in integerrequired
Token expiration time in seconds
Example:
2419200
refresh_token stringrequired
Token that can be used to obtain new access token
Example:
KF0Pwsoz9bDyglLsvDN9hee2_gtF...
scope stringrequired
Scope
Example:
trusted public
created_at integerrequired
Token creation time in seconds
Example:
1582219200
{
"access_token": "412e4ce497df832272db63c627a00...",
"token_type": "Bearer",
"expires_in": 2419200,
"refresh_token": "KF0Pwsoz9bDyglLsvDN9hee2_gtF...",
"scope": "trusted public",
"created_at": 1582219200
}
Authorization: http
name: bearertype: httpscheme: bearerbearerFormat: JWT
- curl
- python
- go
- nodejs
- ruby
- java
- powershell
- CURL
curl -L 'https://api.powerapi.com/api/v1/organisations/me/users/:id/access_tokens' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"data": {
"id": "string",
"type": "users"
}
}'
ResponseClear