Skip to content

Models

Models endpoints are used for getting the models and their details.

List models

Request

Security
oauth2
Query
rootModelnull or string

Root model to get dependencies from

includeModelDefinitionsboolean

When true, the response includes the model definitions

Default:false
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);

Responses

Returns models for the input root Id.

Bodyapplication/json
Array [
idstring

Id of the Model.

Example:"dtmi:com:willowinc:Room;1"
displayNamenull or object

Display Names of the Model keyed by language code.

Example:
{ "en": "Room" }
descriptionnull or object

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." }
modelDefinitionstring

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
uploadTimenull or string, (date-time)

Timestamp when the model was uploaded in ISO 8601 format

Example:"2024-08-30T03:33:54.7015118+00:00"
]
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" } ]