Update object counter config
PATCH/homes/{homeId}/smartModules/{moduleId}/counters/{counterId}
Base URL: https://api.tinkermode.com
Update a new object counter config. The request body should contain a valid object counter config object.
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. | |
counterId | string | Yes | Counter ID. It must be unique per collection. |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
collectionId | string | Yes | Specify the collection ID to update the object counter config. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
areaSearchKeyPrefix | string | No | 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. | ||||||||||||||||
| |||||||||||||||||||
frequency | string | No | 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 for objects searched for the keyword specified here | ||||||||||||||||
Request example
{
"areaSearchKeyPrefix": "office::",
"attributes": [
{
"name": "vendor",
"values": [
"max",
"philips"
]
}
],
"frequency": "60s",
"name": "The number of tools in area",
"objectSearchKeyPrefixes": [
"driver::",
"hammer::"
]
}Responses
204 Successfully created the object counter config.
400 Request failed because of invalid data or 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. |
401 Authorization is required to access this resource.
403 Request failed because of invalid data or 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 The requested counter does not exist or is not accessible.
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. |