token/create

Creates access and refresh tokens by payload.

Authorization

Access JSON Web Token (ManageToken)

Available actions are listed here.

Request Topic and Payload

Topic

dh/request

Payload Representation

{
    "action": {string},
    "requestId": {object},
    "payload": {
        "userId": {object},
        "actions": {array},
        "networkIds": {array},
        "deviceTypeIds": {array},
        "expiration": {datetime}
    }
}

Payload Parameters

Property NameRequiredTypeDescription
actionYesstringAction name: token/create
requestIdNoobjectRequest unique identifier, will be passed back in the response message.
payloadYesobjectUser payload with specific permissions
payload.userIdYesintegerUser identifier.
payload.actionsNoarrayA collection of allowed actions. Available values:
GetNetwork: get information about network
GetDevice: get information about device and device class
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
GetCurrentUser: get current user info
UpdateCurrentUser: update current user
ManageUser: admin permission for managing all users
ManageConfiguration: admin permission for managing server configuration
ManageNetwork: admin permission for managing all networks and its devices
ManageToken: admin permission for creating tokens
payload.networkIdsNoarrayA 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.
payload.deviceTypeIdsNoarrayA 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.
payload.expirationNodatetimeExpiration date (UTC).

Response Topic and Payload

Topic

dh/response/authenticate@{clientId}

Payload Representation

{
    "action": {string},
    "status": {string},
    "requestId": {object},
    "accessToken": {string},
    "refreshToken": {string}
}

Payload Parameters

Property NameTypeDescription
actionstringAction name: token
statusstringOperation execution status (success or error).
requestIdobjectRequest unique identifier as specified in the request message.
accessTokenstringJSON Web Token for authorization.
refreshTokenstringJSON Web Token for refreshing access token.