Assets
Assets are things or items that are owned or assigned to a twin, that a twin can reference and use.
Tasks can be associate or linked to a twin’s asset.
Examples of assets could be a car, menu item or any item for sale.
An asset has a name, a category type (string), and attributes (json object) that can take any key value pair.
A twin has access to the data contained within the asset.
List All Assets Associated with My Twin
§List All Assets Associated with My Twin
To see what assets are assigned to your twin, you can use the following request:
curl --location --request GET '<API_URL>/assets/' \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Organization: <ORG_ID>' \
--header 'X-Twin: <TWIN_ID>' \
--header 'Authorization: Token <ACCESS_TOKEN>'
§Read a Specific Asset
You can query a specific asset
curl --location --request GET '<API_URL>/assets/<ASSET_ID>' \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Organization: <ORG_ID>' \
--header 'X-Twin: <TWIN_ID>' \
--header 'Authorization: Token <ACCESS_TOKEN>'
§Add an Asset
To add an asset to a twin, you need to define a name, a category and add custom attribute values.
curl --location --request POST '<API_URL>/assets/' \ \
--header 'Content-Type: application/vnd.api+json' \ \
--header 'X-Organization: <ORG_ID>' \ \
--header 'X-Twin: <TWIN_ID>' \ \
--header 'Authorization: Token <ACCESS_TOKEN>' \
--data-raw '{ \
"data": { \
"type": "assets", \
"attributes": {
"name": "<VALUE>", \
"category": "<VALUE>", \
"attributes": { \
"<VALUE>": "<VALUE>" \
} \
\
} \
} \
}'
§Update an Asset
You can update an individual asset by querying the specific asset ID.
curl --location --request PATCH '<API_URL>/assets/<ASSET_ID>/' \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Organization: <ORG_ID>' \
--header 'X-Twin: <TWIN_ID>' \
--header 'Authorization: Token <ACCESS_TOKEN>' \
--data-raw '{
"data": {
"type": "assets",
"id" : "<ASSET_ID>",
"attributes": {
"attributes": {
"<VALUE>": "<VALUE>"
}
}
}
}'
§Delete an Asset
To delete an asset, you can do a DELETE request to the specific Asset ID url
curl --location --request DELETE '<API_URL>/assets/<ASSET_ID>' \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Organization: <ORG_ID>' \
--header 'X-Twin: <TWIN_ID>' \
--header 'Authorization: Token <ACCESS_TOKEN>'
§Query Parameters
Query Parameter | Expected Input | Description |
---|---|---|
category | String | Filter assets by the category |
name | String | Filter & search assets by name |