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
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
entityClass | string | No | Deprecated. Use entityClasses instead.
| |
entityClasses | string | No | Returns entity instances of the passed entity classes by a comma-separated string like entityClasses=building,floor,room.
| |
homeId | integer | No | Return entity instances in a specific home. If the caller uses a user API key, the user must be a member of the home. | |
limit | integer | No | default: 25; min: 1 | Maximum number of entity instances to return. |
parentId | string | No | Returns 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.
| |
recursive | boolean | No | default: false | If 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. |
skip | integer | No | default: 0; min: 0 | Number of entity instances to skip over. |
sortBy | string | No | Sorts 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.
| |
userId | integer | No | Return 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:
| Property | Type | Required | Constraints | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attributes | object | No | The attributes that belong to the entity instance, separated as key-value pairs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | string | No | read-only (server-generated); format: date-time | Timestamp of entity creation. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
displaySettings | object | No | Various user interface settings used for display of the entity instance. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
entityClass | string | Yes | read-only (server-generated) | The entity class that the entity was instantiated from. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
entityId | string | Yes | read-only (server-generated) | Unique entity ID. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
homeId | integer | Yes | read-only (server-generated) | Home that this entity belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
metrics | array<object> | No | read-only (server-generated) | Meta data of the metrics associated with this entity instance. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parentId | string | No | The ID of the entity instance that is a parent of the instance. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectId | integer | Yes | read-only (server-generated) | Project that this entity belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
suspendAlertRuleEvaluationConditions | array<object> | No | An array of condition for suspending alerts, which are evaluated as if they are concatenated with OR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timeZone | string | Yes | read-only (server-generated) | The time zone that the entity exists in. This should be a time zone name defined in the IANA TZ Database. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
uiSettings | object | No | An opaque object used by UI applications to store any additional settings. These will override the entity class uiSettings. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
updatedAt | string | No | read-only (server-generated); format: date-time | Timestamp of the last update on the entity. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |