create
Creates and returns access and refresh tokens for the given user and access rights.
Request
HTTP Request
POST /token/create
Authorization
Access JSON Web Token (ManageToken)
Request Body
In the request body, supply user identifier, rights and expiration date.
Available actions are listed here.
Property Name | Required | Type | Description |
---|---|---|---|
userId | Yes | integer | User identifier. |
expiration | No | datetime | Expiration date (UTC). |
actions | No | array | A collection of allowed actions. Available values: GetNetwork: get information about network GetDevice: get information about device and device class GetDeviceState: get information about current device equipment state GetDeviceNotification: get or subscribe to device notifications GetDeviceCommand: get or subscribe to commands sent to device RegisterDevice: register a device CreateDeviceNotification: post notifications on behalf of device CreateDeviceCommand: post commands to device UpdateDeviceCommand: update status of commands on behalf of device |
networkIds | No | array | A collection of identifiers of allowed networks. Only API requests for devices within the allowed networks will be authorized with this permission. Set to null to allow callees to access all networks permitted for the owner user. |
deviceTypeIds | No | array | A collection of unique identifiers of allowed device types. Only API requests for allowed device types will be authorized with this permission. Set to null to allow callees to access all devices permitted for the owner user. |
Response
If successful, this method returns a pair of access and refresh tokens.
Property Name | Type | Description |
---|---|---|
accessToken | string | Access JSON Web Token. |
refreshToken | string | Refresh JSON Web Token. |
Updated over 6 years ago