Get list of entity instances

GET/projects/{projectId}/entities

Base URL: https://api.tinkermode.com

Get entity instances of a project. In a project without permission-based access control, a caller other than a project API key must specify homeId and be a member of that home. userId is not supported there. In a project with permission-based access control and without userId, a project API key can list every entity. A user or service account gets only the entities that it can read. Entities covered by a deny statement are left out. A self-scope read permission on root alone covers no entity, so the list is empty.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user, service account, or project API key.

Path parameters

NameTypeRequiredConstraintsDescription
projectIdintegerYesThe unique ID for a specified project.

Query parameters

NameTypeRequiredConstraintsDescription
entityClassstringNoDeprecated. Use entityClasses instead.
entityClassesstringNoReturns entity instances of the passed entity classes by a comma-separated string like entityClasses=building,floor,room.
homeIdintegerNoReturn entity instances in a specific home. If the caller uses a user API key, the user must be a member of the home.
limitintegerNodefault: 25; min: 1Maximum number of entity instances to return.
parentIdstringNoReturns child entity instances of the specified parent entity. If the reserved value 'root' is passed, root entity instances are returned, except in the case below. For a user or service account that can read only some entities, 'root' without recursive=true returns the entities that its self and selfWithDescendants read permissions name, when it can read the entity but not the entity's parent. A parent that only a self-scope deny hides is skipped, and the next ancestor up is checked. These entities can be at any depth of the tree. Other readable entities, such as those under a descendants read permission, are returned when their parent is passed as parentId. For a user or service account whose read permission covers every entity, such as selfWithDescendants on root, 'root' without recursive=true returns the root entities that it can read. When a self-scope deny hides a root entity, this request does not return the readable children of that entity, so clients cannot use it to find them. recursive=true returns them.
recursivebooleanNodefault: falseIf the parentId query parameter is used, and this parameter is true, all descendants of the specified parent entity will be returned (children, grandchildren, and so on). This parameter is ignored if parentId is not specified.
skipintegerNodefault: 0; min: 0Number of entity instances to skip over.
sortBystringNoSorts the returned results by the given sort field and sort order in the format sortField:sortOrder e.g. attributes.minTemp:asc sortOrder can be asc or desc. The default sort order is ascending.
userIdintegerNoReturn entity instances that a particular user has access to. The caller must contain the API key of the user, the API key of a user who has permission to all resources of a project, or a Project API Key with admin permission. A project without permission-based access control does not support this parameter.

Responses

200 Successful retrieval of list of entity instances.

Content type: application/json

Represents an entity instance created by a project.

An array of objects with the following shape:

PropertyTypeRequiredConstraintsDescription
attributesobjectNoThe attributes that belong to the entity instance, separated as key-value pairs.
createdAtstringNoread-only (server-generated); format: date-timeTimestamp of entity creation.
displaySettingsobjectNoVarious user interface settings used for display of the entity instance.
Properties of displaySettings
PropertyTypeRequiredConstraintsDescription
descriptionstringNoAn intuitive description for the entity instance for display.
iconDataobjectNoMetadata used for the uploaded icon of the entity instance.
Properties of iconData
PropertyTypeRequiredConstraintsDescription
fileNamestringNoFileName represents the name of the file uploaded.
urlstringNoA temporary signed URL for file download.
imageDataobjectNoMetadata used for the uploaded image of the entity instance.
Properties of imageData
PropertyTypeRequiredConstraintsDescription
fileNamestringNoFileName represents the name of the file uploaded.
urlstringNoA temporary signed URL for file download.
namestringNoThe display name for the entity instance.
entityClassstringYesread-only (server-generated)The entity class that the entity was instantiated from.
entityIdstringYesread-only (server-generated)Unique entity ID.
homeIdintegerYesread-only (server-generated)Home that this entity belongs to.
metricsarray<object>Noread-only (server-generated)Meta data of the metrics associated with this entity instance.
Properties of metrics
PropertyTypeRequiredConstraintsDescription
metricsDefinitionIdstringNoCorresponding metrics definition ID in entity class.
parentIdstringNoThe ID of the entity instance that is a parent of the instance.
projectIdintegerYesread-only (server-generated)Project that this entity belongs to.
suspendAlertRuleEvaluationConditionsarray<object>NoAn array of condition for suspending alerts, which are evaluated as if they are concatenated with OR
Properties of suspendAlertRuleEvaluationConditions
PropertyTypeRequiredConstraintsDescription
alertConditionTypesarray<string>NoAn array of alert condition types. This allows suspending alerts based on the alert types. All rules of the specified condition type will be suspended.
fromstringNoformat: date-timeTimestamp of the begin of the interval. Null applies this rule without this time constrains
includeDescendantsbooleanNoBoolean value that shows whether alert rules are suspended for only this entity or this entity and descendants
rulesarray<number>NoAn array of alertRuleId. Empty array means all rules
tostringNoformat: date-timeTimestamp of the end of the interval. Null applies this rule without this time constrains
timeZonestringYesread-only (server-generated)The time zone that the entity exists in. This should be a time zone name defined in the IANA TZ Database.
uiSettingsobjectNoAn opaque object used by UI applications to store any additional settings. These will override the entity class uiSettings.
updatedAtstringNoread-only (server-generated); format: date-timeTimestamp of the last update on the entity.

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.