Thing Groups help to organize things within a particular organization.

Create

Beyond the Global Thing Group that’s automatically created when a new Organization is created, new Thing Groups can be created in an Organization by a User with Creator Role permissions. The API JSON POST must contain the desired Thing Group name and description in the body of the request. The API JSON response contains the Thing Group’s unique identity.

RequestResponse
POST https://<moab url>/api/v1/thinggroupSuccess
{
“Name”:”<thing group name>”,
“Description”:”<thing group description>”
}
{
“id”:<thing group id>,
“status”: “success”,
“message”: “thing group created”
}
Failure
{
“id”:”0″,
“status”:”error”,
“message”:”thing group creation failed”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X POST ‘https://<moab url>/api/v1/ThingGroup’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’ \
–data-raw ‘{
“name”: “<name>”,
“description”: “<description>”
}’

Read All

To retrieve a list of all Thing Groups in a particular Organization, a User from that Organization with Reader Role permissions makes an API GET request with no parameters. The API JSON response contains repeating Thing Group identities, names, and descriptions.

RequestResponse
GET https://<moab url>/api/v1/thinggroupSuccess
[
{
“id”: <thing group id>,
“name”: “<thing group name>”,
“description”: “<thing group description>”
},
{
“id”: <thing group id>,
“name”: “<thing group name>”,
“description”: “<thing group description>”
}
]
Failure
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Not Found”,
“status”: 404,
“traceId”: “|…”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X GET ‘https://<moab url>/api/v1/ThingGroup’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’

Read One

To retrieve a Thing Group in a particular Organization, a User from that Organization with Reader Role permissions makes an API GET request with the Thing Group identity parameter at the end of the URL. The API JSON response contains the Thing Group identity, name, and description.

RequestResponse
GET https://<moab url>/api/v1/thinggroup/<id>Success
{
“id”: <thing group id>,
“name”: “<thing group name>”,
“description”: “<thing group description>”
}
Failures
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Not Found”,
“status”: 404,
“traceId”: “|…”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “One or more validation errors occurred.”,
“status”: 400,
“traceId”: “|…”,
“errors”: { [ … ] }
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X GET ‘https://<moab url>/api/v1/ThingGroup/<id>’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’

Delete

To delete a Thing Group in a particular Organization, a User from that Organization with Creator or Contributor Role permissions makes an API DELETE request with the Thing Group identity parameter at the end of the URL. The API JSON response contains the Thing Group identity.

RequestResponse
DELETE https://<moab url>/api/v1/thinggroup/<id>Success
{
“id”: <thing group id>,
“status”: “success”,
“message”: “thing group deleted”
}
Failures
{
“id”: <thing group id>,
“status”: “error”,
“message”: “thing group deletion failed”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “One or more validation errors occurred.”,
“status”: 400,
“traceId”: “|…”,
“errors”: { [ … ] }
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X DELETE ‘https://<moab url>/api/v1/ThingGroup/<id>’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’