Things are at the heart of the Moab system and represent people, machines and environmental systems that send performance, health, and state data about themselves within a particular organization. Each Thing you intend to connect to Moab must be entered in this registry in order to ensure the security and integrity of the system. Additionally, each Thing inherits its properties from a Thing Model.

Create

New Things can be created in an Organization by a User with Creator Role permissions. The API JSON POST must contain the desired Thing name, description, security token expiration date, associated thing model, the thing group it belongs to and whether or not it’s enabled in the body of the request. The API JSON response contains the Thing’s unique identity and security token that will be used to authenticate with Moab when sending telemetry data.

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

Read All

To retrieve a list of all Things 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 identities, names, descriptions, security tokens, token expirations, thing models, organizations, thing groups and whether the things are enabled.

RequestResponse
GET https://<moab url>/api/v1/thingSuccess
[
    {
        “id”: <thing id>,
        “name”: “<thing name>”,
        “description”: “<thing description>”,
        “securityToken”: <thing security token>,
        “tokenExpiration”: “<YYYY-MM-DD>”,
        “thingModel”: <thing model id>,
        “organization”: <org id>,
        “thingGroup”: <thing group id>,
        “enabled”: <0 or 1>
    },
    {
        “id”: <thing id>,
        “name”: “<thing name>”,
        “description”: “<thing description>”,
        “securityToken”: <thing security token>,
        “tokenExpiration”: “<YYYY-MM-DD>”,
        “thingModel”: <thing model id>,
        “organization”: <org id>,
        “thingGroup”: <thing group id>,
        “enabled”: <0 or 1>
    }
]
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/Thing’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’

Read One

To retrieve a Thing in a particular Organization, a User from that Organization with Reader Role permissions makes an API GET request with the Thing identity parameter at the end of the URL. The API JSON response contains the Thing identity, name, description, security token, token expiration, thing model, organization, thing group and whether the thing is enabled.

RequestResponse
GET https://<moab url>/api/v1/thing/<id> Success
{
    “id”: <thing id>,
    “name”: “<thing name>”,
    “description”: “<thing description>”,
    “securityToken”: <thing security token>,
    “tokenExpiration”: “<YYYY-MM-DD>”,
    “thingModel”:  <thing model id>,
    “organization”: <org id>,
    “thingGroup”: <thing group id>,
    “enabled”: <0 or 1>
}
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/Thing/<id>’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’

Delete

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

RequestResponse
DELETE https://<moab url>/api/v1/thing/<id> Success
{
    “id”: <thing id>,
    “status”: “success”,
    “message”: “thing deleted”
}
Failures
{
“id”: <thing id>,
“status”: “error”,
“message”: “thing 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/Thing/<id>’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’