Security
oauth2
GET
const query = new URLSearchParams({
includeRelationships: 'false'
}).toString();
const id = 'YOUR_id_PARAMETER';
const instance = 'YOUR_instance_PARAMETER';
const resp = await fetch(
`https://${instance}.app.willowinc.com/api/v3/twins/${id}?${query}`,
{
method: 'GET',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
}
}
);
const data = await resp.text();
console.log(data);Twin information successfully retrieved.
Timestamp when the twin was last updated in ISO 8601 format.
Example:"2024-08-30T03:49:30.4062816+00:00"
Concurrency tag for optimistic concurrency control. Populated from the underlying ADT entity when sourced from AdtQuery; null when sourced from ADX.
This field will contain properties and components as defined in the contents section of the DTDL definition of the twin.
Example:
{ "levelNumber": 0, "mappedIds": [ { … }, { … }, { … }, { … }, { … }, { … } ], "name": "Floor_1", "uniqueID": "a360cf30-c112-40a1-b4b4-f65da82fa9e8", "externalID": "FLRPXxxxxxxxxxxxxxxxx", "code": "L01", "siteID": "104bd33c-a697-4027-b6a6-677e30a53d09", "alternateClassification": { "brickSchema": { … } }, "externalIds": { "mappingKey": "msrc:///CON5xxxxxxxxxxxxxxxx@willow-source/twin/TW-DD-II-L01" }, "area": { "$metadata": { … } } }
Incoming relationships
Example:
[ { "Id": "Room-L01-100_isPartOf_TW-DD-II-L01", "targetId": "TW-DD-II-L01", "sourceId": "Room-L01-100", "name": "isPartOf" } ]
Response
{ "id": "TW-DD-II-L01", "modelId": "dtmi:com:willowinc:Level;1", "lastUpdateTime": "2024-08-30T03:49:30.4062816+00:00", "contents": { "levelNumber": 0, "mappedIds": [ … ], "name": "Floor_1", "uniqueID": "a360cf30-c112-40a1-b4b4-f65da82fa9e8", "externalID": "FLRPXxxxxxxxxxxxxxxxx", "code": "L01", "siteID": "104bd33c-a697-4027-b6a6-677e30a53d09", "alternateClassification": { … }, "externalIds": { … }, "area": { … } }, "incomingRelationships": [ { … } ], "outgoingRelationships": [ { … } ] }