Security
oauth2
- https://.app.willowinc.com/api/v3https://.app.willowinc.com/api/v3/models
const query = new URLSearchParams({
rootModel: '{rootModel}',
includeModelDefinitions: 'false'
}).toString();
const instance = 'YOUR_instance_PARAMETER';
const resp = await fetch(
`https://${instance}.app.willowinc.com/api/v3/models?${query}`,
{
method: 'GET',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
}
}
);
const data = await resp.text();
console.log(data);Returns models for the input root Id.
Array []
Description of the Model keyed by language code.
Example:
{ "en": "A portion of space within a building that's usually enclosed and has its own walls, floor, and ceiling." }
Encoded JSON string of DTDL model definition.
Example:"{\"@id\":\"dtmi:com:willowinc:Room;1\",\n \"@type\":\"Interface\",\n \"displayName\":{\"en\":\"Room\"},\n \"description\":{\"en\":\"A portio
Response
[ { "id": "dtmi:com:willowinc:Room;1", "displayName": { … }, "description": { … }, "modelDefinition": "{\"@id\":\"dtmi:com:willowinc:Room;1\",\n \"@type\":\"Interface\",\n \"displayName\":{\"en\":\"Room\"},\n \"description\":{\"en\":\"A portion of space within a building that's usually enclosed and has its own walls, floor, and ceiling.\"},\n \"extends\":[\"dtmi:com:willowinc:Space;1\"],\n \"contents\":[{\n \"@type\":\"Property\",\n \"name\":\"type\",\n \"displayName\":{\"en\":\"Type\"},\n \"writable\": true,\n \"schema\":\"string\"\n },\n {\n \"@type\":[\"Property\",\"Volume\"],\n \"name\":\"volume\",\n \"displayName\":{\"en\":\"Volume\"},\n \"writable\": true,\n \"schema\":\"double\",\n \"unit\":\"cubicMetre\"\n },\n {\n \"@type\":[\"Property\",\"ValueAnnotation\",\"Override\"],\n \"displayName\":{\"en\":\"volume unit\"},\n \"name\":\"volumeUnit\",\n \"annotates\":\"volume\",\n \"overrides\":\"unit\",\n \"schema\":\"VolumeUnit\",\n \"writable\": true\n }\n ],\n \"@context\":[\n \"dtmi:dtdl:context;3\",\n \"dtmi:dtdl:extension:quantitativeTypes;…" , "uploadTime": "2024-08-30T03:33:54.7015118+00:00" } ]