Sofar logo
Sofar logo
Api
Delete a monitors relation DELETECollect monitors relations (replaced by POST /v1/role/{roleId}/monitors/query) GETCollect monitors relations POSTCreate or update a monitors relation PUTUpdate an existing monitors relation PUT
Monitors
PUT
/v1/role/{roleId}/monitors/{monitorsId}

Authorization

accessBearerAuth
AuthorizationBearer <token>

In: header

Create or update a monitors relation PUT

Create a monitors relation (or update the existing one) between a role and a device.<br><br> To execute this query, the user must be a member of an authorizing role which satisfies both of the following conditions: <ol> <li> One of the following role-related conditions is true: <ul> <li> The authorizing role has *direct or indirect* deviceManagement rights for the role from which the monitors relation is created (or updated) </li> <li> The authorizing role has *indirect* roleManagement rights for the role from which the monitors relation is created (or updated) </li> </ul> </li> <li> The authorizing role has monitorManagement rights for the device to which the monitors relation is created </li> </ol>

/.well-known/jwks.json GET

Next Page

Path Parameters

roleId*integer

Id of the role of the updated monitors relation

Range0 <= value
monitorsId*|array<>

Id of the updated monitors relation

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://api.eniris.be/v1/role/0/monitors/0" \  -H "Content-Type: application/json" \  -d '{    "monitorManagement": true,    "reads": [      "string"    ],    "edits": [      "string"    ]  }'
{
  "monitors": {
    "id": 0,
    "roleId": 0,
    "deviceId": 0,
    "monitorManagement": true,
    "reads": [
      "string"
    ],
    "edits": [
      "string"
    ]
  }
}
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Missing or misformatted query parameter or body"
}
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Failed to verify token"
}
{
  "statusCode": 403,
  "error": "Forbidden",
  "message": "User does not have sufficient rights"
}
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "The monitors relation cannot be updated, since it is the only monitors relation of the device which allows monitorManagement rights, and the proposed change would revoke these rights, resulting in a device with uneditable monitors relations."
}

Update an existing monitors relation. To execute this query, the user must be a member of an authorizing role which satisfies both of the following conditions: One of the following role-related conditions is true: The authorizing role has direct or indirect deviceManagement rights for the role from which the monitors relation is updated The authorizing role has indirect roleManagement rights for the role from which the monitors relation is updated The authorizing role has monitorManagement rights for the device to which the monitors relation is updated

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.

monitorManagement*boolean

Indicates whether the role has the right to create new monitors relations to the monitored device. If true, the role may read and edit any device property.

reads*array<>

A list of device properties which may be read by the role monitoring the device

edits*array<>

A list of device properties which may be both read and edited by the role monitoring the device