Get object counter configs
GET/homes/{homeId}/smartModules/{moduleId}/counters
Base URL: https://api.tinkermode.com
Get a list of object counter configs.
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 |
|---|---|---|---|---|
homeId | integer | Yes | The unique ID for a home. | |
moduleId | string | Yes | The unique ID for a smart module. |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
collectionIds | string | No | Specify the list of collection IDs to search object counter configs. The collectionIds parameter allows multiple values, separated by commas (",").
| |
counterIds | string | No | Specify the list of counter IDs to search object counter configs. The counterIds parameter allows multiple values, separated by commas (",").
|
Responses
200 A list of object counter configs are returned.
Content type: application/json
Configuration of an object counter.
An array of objects with the following shape:
| Property | Type | Required | Constraints | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
areaSearchKeyPrefix | string | Yes | The target area ID prefix. The object counter counts objects in the found area and stores the results per area. | ||||||||||||||||
attributes | object | No | The attribute names and values to search the objects. | ||||||||||||||||
| |||||||||||||||||||
collectionId | string | Yes | The collection ID to count the number of objects. It allows you to specify wildcard character (*) to count objects in the all of collections in the module. | ||||||||||||||||
counterId | string | Yes | pattern: ^[a-zA-Z0-9]([a-zA-Z0-9\-_\:]*[a-zA-Z0-9])*$ | Object counter ID. Must be unique within each home. Must be 1 or more alphanumeric characters and may contain dashes ('-'), underscores ('_'), and colons (':') can be used after the first alphanumeric character but must be followed by 1+ alphanumeric characters. | |||||||||||||||
frequency | string | Yes | one of: 5s, 30s, 60s | The frequency to count objects in the areas. | |||||||||||||||
name | string | No | The name of the object counter config. | ||||||||||||||||
objectSearchKeyPrefixes | array<string> | No | The searchKey prefixes to filter the counted objects. The object counter counts objects searched with the keywords specified here | ||||||||||||||||
Response example
[
{
"areaSearchKeyPrefix": "office::",
"attributes": [
{
"name": "vendor",
"values": [
"max",
"philips"
]
}
],
"collectionId": "*",
"counterId": "number_of_tools",
"frequency": "30s",
"name": "The number of tools in area",
"objectSearchKeyPrefixes": [
"driver::",
"hammer::"
]
},
{
"areaSearchKeyPrefix": "office::",
"attributes": [
{
"name": "vendor"
}
],
"collectionId": "*",
"counterId": "number_of_materials",
"frequency": "60s",
"name": "The number of materials in area",
"objectSearchKeyPrefixes": [
"nail::",
"screw::"
]
}
]401 Authorization is required to access this resource.
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. |
404 Any requested object counter config data entries are not found.
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. |