Get all (or some of) the devices which are monitored by roles of which the user is a member
Authorization
accessBearerAuth In the value field below, fill in the access token. It has a 10 minutes validity period. A valid token can be obtained via the /accesstoken endpoint (call), AFTER authorization with refreshBearerAuth and the refresh token.
In: header
Request Body
application/json
Filters on which devices should be returned, the returned device properties and a skipHash field to avoid unnecessary data transfer.
TypeScript Definitions
Use the request body type in TypeScript.
Before sending a reply, a base64 encoded sha256 digest is calculated by sorting the devices by id and updating the hash with the lastUpdate properties of each of the devices. When the digest matches this property, code 204 with an empty response is returned.
Only return the specified device fields. If no fields are specified, all device fields are returned.
Indexed filters for which matching devices are returned
Non-indexed filters on which matching devices are returned. The conditions can only be applied to properties which the user can see. These filters are applied on the application layer and are rather expensive.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.eniris.be/v1/device/query" \ -H "Content-Type: application/json" \ -d '{}'{
"device": [
{
"id": 0,
"lastUpdate": "string",
"properties": {},
"userRights": {
"propertyEditabilities": {
"property1": true,
"property2": true
},
"monitorManagement": true
}
}
]
null{
"statusCode": 400,
"error": "Bad Request",
"message": "Missing or misformatted query parameter or body"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Failed to verify token"
}Create a new device and the monitors relation which connects this device to a role POST
A user can only execute this call is he is a member of an authorizing role which satisfies one of the following conditions: <ul> <li> The authorizing role has *direct or indirect* deviceManagement rights for the role for which a device is created </li> <li> The authorizing role has *indirect* roleManagement rights for the role for which a device is created </li> </ul>
Update an existing device PUT
A user can only execute this call is he is a member of an authorizing role such that this role has a monitors relation with monitorManagement rights. Alternatively, the user must be member of a set of roles with monitors relations for the specified device, such that the set of device properties which these relations allow to edit are a subset of the device properties which are specified in the current request.
