Authentication

Provides a mechanism of authentication to this API using JSON Web Tokens.

Methods

MethodAuthorizationUriDescription
loginNonePOST /tokenCreates and returns access and refresh tokens for the given user.
createAccess JSON Web Token (ManageToken)POST /token/createCreates and returns access and refresh tokens for the given user and access rights.
refreshNonePOST /token/refreshCreates and returns a new access token for the given refresh token.
plugin/createAccess JSON Web Token (ManagePlugin)POST /token/plugin/createCreates JWT access and refresh tokens for plugin
plugin/authenticateNoneGET /token/plugin/authenticateAuthenticates a plugin and JWT Plugin payload.

Resource Representation

{
    "userId": {integer},
    "expiration": {datetime},
    "actions": {array},
    "networkIds": {array},
    "deviceIds": {array}
}
Property NameTypeDescription
userIdintegerUser identifier.
expirationdatetimeExpiration date (UTC).
actionsarrayA 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
networkIdsarrayA 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.
deviceIdsarrayA collection of unique identifiers of allowed devices. Only API requests for allowed devices will be authorized with this permission. Set to null to allow callees to access all devices permitted for the owner user.

Available actions:

JWT tokens contain user-related information and permissions list which could be represented with ids or action names.

ActionStringId
Any*0
Nonenull1
Get NetworkGetNetwork2
Get DeviceGetDevice3
Get Device NotificationGetDeviceNotification4
Get Device CommandGetDeviceCommand5
Register DeviceRegisterDevice6
Create Device CommandCreateDeviceCommand7
Update Device CommandUpdateDeviceCommand8
Create Device NotificationCreateDeviceNotification9
Get Current UserGetCurrentUser10
Update Current UserUpdateCurrentUser11
Manage User (admin)ManageUser12
Manage Configuration (admin)ManageConfiguration13
Manage Network (admin)ManageNetwork14
Manage TokenManageToken15
Manage PluginManagePlugin16
Get Device TypeGetDeviceType17
Manage Device Type (admin)ManageDeviceType18