Digital Twins

A digital twin can perform actions on your behalf. It can access information, and be assigned assets that it can utilize in its actions.

A digital twin is contained, and accessed within the context of a specific organization.

You can create as many twins as you require to represent things, people, or items. Or you can have one twin that can perform many actions.

Listing All Active Twins in an Organization

curl --location --request GET '<API_URL>/twins/' \ --header 'X-Organization: <ORG_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>' { "data": [ { "type": "twins", "id": "<TWIN NAME>", "attributes": { "created": "<TIMESTAMP OF DATE CREATED>", "modified": "<TIMESTAMP OF DATE LAST MODIFIED>", "name": "<TWIN NAME>", "description": null } }, {...}, … ] }

Displaying Details for a Specific Twin

curl --location --request GET '<API_URL>/twins/<TWIN_ID>/' \ --header 'X-Organization: <ORG_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>' --header 'Content-Type: application/vnd.api+json' \ { "data": { "type": "twins", "id": "<TWIN_ID>", "attributes": { "created": "<TIMESTAMP OF DATE CREATED>", "modified": "<TIMESTAMP OF DATE LAST MODIFIED>", "name": "My New Twin", "description": null } }, }

Creating a New Twin

curl --location --request POST '<API_URL>/twins/' \ --header 'X-Organization: <ORG_ID>' \ --header 'Content-Type: application/vnd.api+json' \ --header 'Authorization: Token <ACCESS_TOKEN>' --data-raw '{"data": {"type": "twins", "attributes":{"name": "<YOUR TWIN NAME>", "description": "<THIS FIELD IS OPTIONAL>"}}}'

Modifying Details For a Specific Twin

curl --location --request PATCH '<API_URL>/twins/<TWIN_ID>/' \ --header 'X-Organization: <ORG_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>' --header 'Content-Type: application/vnd.api+json' \ --data-raw '{"data": {"type": "twins", "attributes":{"name": "<UPDATED NAME>", "description": "<UPDATED DESCRIPTION>"}}}'

Deleting a Twin

curl --location --request DELETE '<API_URL>/twins/<TWIN_ID>/' \ --header 'X-Organization: <ORG_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>' \ --header 'Content-Type: application/vnd.api+json' \ { "data": { "status_code": 200, } }