Permissions
User permissions and other object linking, like User to Device, User to Geofence, User to Notification, etc.
The Permissions Model
A permission is represented by the following schema:
Scheme
- Name
userId- Type
- integer
- Description
- User id, can be only first parameter
- Name
deviceId- Type
- integer
- Description
- Device id, can be first parameter or second only in combination with userId
- Name
groupId- Type
- integer
- Description
- Group id, can be first parameter or second only in combination with userId
- Name
geofenceId- Type
- integer
- Description
- Geofence id, can be second parameter only
- Name
notificationId- Type
- integer
- Description
- Notification id, can be second parameter only
- Name
calendarId- Type
- integer
- Description
- Calendar id, can be second parameter only and only in combination with userId
- Name
attributeId- Type
- integer
- Description
- Computed attribute id, can be second parameter only
- Name
driverId- Type
- integer
- Description
- Driver id, can be second parameter only
- Name
managedUserId- Type
- integer
- Description
- User id, can be second parameter only and only in combination with userId
- Name
commandId- Type
- integer
- Description
- Saved command id, can be second parameter only
POST/permissions
Link an Object to another Object
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
HTTP Authorization Scheme: bearer
Request body schema
- Name
application/json- Type
- schema
- Description
Body schema
- Name
userId- Type
- integer
- Description
- User id, can be only first parameter
- Name
deviceId- Type
- integer
- Description
- Device id, can be first parameter or second only in combination with userId
- Name
groupId- Type
- integer
- Description
- Group id, can be first parameter or second only in combination with userId
- Name
geofenceId- Type
- integer
- Description
- Geofence id, can be second parameter only
- Name
notificationId- Type
- integer
- Description
- Notification id, can be second parameter only
- Name
calendarId- Type
- integer
- Description
- Calendar id, can be second parameter only and only in combination with userId
- Name
attributeId- Type
- integer
- Description
- Computed attribute id, can be second parameter only
- Name
driverId- Type
- integer
- Description
- Driver id, can be second parameter only
- Name
managedUserId- Type
- integer
- Description
- User id, can be second parameter only and only in combination with userId
- Name
commandId- Type
- integer
- Description
- Saved command id, can be second parameter only
Responses
- Name
204- Type
- success
- Description
No content
- Name
400- Type
- error
- Description
No permission
Request
POST
/permissionscurl --location 'https://gw.onemap8.com/api/permissions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"userId": "<integer>",
"deviceId": "<integer>",
"groupId": "<integer>",
"geofenceId": "<integer>",
"notificationId": "<integer>",
"calendarId": "<integer>",
"attributeId": "<integer>",
"driverId": "<integer>",
"managedUserId": "<integer>",
"commandId": "<integer>"
}'
Response
No content
DELETE/permissions
Unlink an Object from another Object
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
HTTP Authorization Scheme: bearer
Request body schema
- Name
application/json- Type
- schema
- Description
Body schema
- Name
userId- Type
- integer
- Description
- User id, can be only first parameter
- Name
deviceId- Type
- integer
- Description
- Device id, can be first parameter or second only in combination with userId
- Name
groupId- Type
- integer
- Description
- Group id, can be first parameter or second only in combination with userId
- Name
geofenceId- Type
- integer
- Description
- Geofence id, can be second parameter only
- Name
notificationId- Type
- integer
- Description
- Notification id, can be second parameter only
- Name
calendarId- Type
- integer
- Description
- Calendar id, can be second parameter only and only in combination with userId
- Name
attributeId- Type
- integer
- Description
- Computed attribute id, can be second parameter only
- Name
driverId- Type
- integer
- Description
- Driver id, can be second parameter only
- Name
managedUserId- Type
- integer
- Description
- User id, can be second parameter only and only in combination with userId
- Name
commandId- Type
- integer
- Description
- Saved command id, can be second parameter only
Responses
- Name
204- Type
- success
- Description
No content
- Name
400- Type
- error
- Description
No permission
Request
DELETE
/permissionscurl --location 'https://gw.onemap8.com/api/permissions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"userId": "<integer>",
"deviceId": "<integer>",
"groupId": "<integer>",
"geofenceId": "<integer>",
"notificationId": "<integer>",
"calendarId": "<integer>",
"attributeId": "<integer>",
"driverId": "<integer>",
"managedUserId": "<integer>",
"commandId": "<integer>"
}'
Response
No content