Read all Assignments

Retrieves the all assignments defined for the specified thing or sensor

With this method, you can retrieve the complete list of assignments that have been created for the thing, or sensor, respectively, passed as input parameter to the method. Note that the two parameters should be considered mutually exclusive. You can also omit both parameters. In that case, the system returns a complete list of all existing assignments on instance level.

Request

URI: /v1/Assignments

HTTP Method: GET

Permissions:

<thing>.r

<thingconf!t5>.r

<thing!t5>.r

<thing!t5>.conf.r

Request Headers

Header Required Values
Authorization Yes JWT (JSON Web Token)

Request Parameters

Parameter Required Data Type Description Parameter Type
thingId No string Unique identifier of the thing for which assignments shall be retrieved Query string
sensorId No string Unique identifier of the sensor for which assignments shall be retrieved Query string
$skip No integer Number of the first n records to be excluded from the result set Query string
$top No integer Number of records to include in the result set Query string

Request Example

GET /v1/Assignments
GET /v1/Assignments?thingId=A68BCF0D32914C19AACD1225AF887330
GET /v1/Assignments?sensorId=220

The above example shows the three different flavors of reading assignments:

  • Unfiltered request
  • Read assignments for a specified thing
  • Read assignments for a specified sensor

Response

Response Status and Error Codes

Code Description
200 Assignments retrieved successfully, or No mapping found for the specified ID (empty array).

Response Example

GET /v1/Assignments?thingId=A68BCF0D32914C19AACD1225AF887330
[
  {
    "id": "f38fac75-7e65-4953-86a9-92330adf4e3a",
    "thingId": "A68BCF0D32914C19AACD1225AF887330",
    "sensorIds": ["220", "221"],
    "mappingId": "adfed57a-a537-4078-813b-ee8381e9fe26",
    "ETag": 1
  }
]