Get the current number of objects in an areas
GET/homes/{homeId}/smartModules/{moduleId}/collections/{collectionId}/data/count
Base URL: https://api.tinkermode.com
Get the current number of objects in an area by collection ID. Use the begin and end
parameters to specify the time range to filter target objects. Do not count the objects outside
of this period. The counter values are calculated for each value specified for the areaIds
parameter. areaIds, floorId, and searchKeyPrefixes are optional parameters to filter
the target objects.
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. | |
collectionId | string | Yes | Collection ID. It must be unique per home. |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
areaIds | string | No | Specify area IDs to count the number of objects in the specified areas from the
GeoTSDB storage. The areaIds parameter allows multiple values, separated by
commas (","). The counter values are calculated for each value specified for
areaIds parameter.
| |
attributeQuery | string | No | A filter string starting with a conjunction. Supported conjunctions are AND()
and OR(). A conjunction takes a comma-separated condition string like AND (group==="group_1",maxSpeed<5). Each condition string defines a filter for the
attribute value. The left-hand side must be a valid attribute field name. The
right-hand side must be a value condition. For example, group==="group_1" matches
any records where the group attribute value exactly matches "group_1".
Supported operators are following
| Operator | |
| --- | --- |
| === | exact match |
| == | substring match |
| ~== | included in array as exact match. name~==["john"|"jeff"|"jack"] matches one of the three. |
| ~= | included in array as substring match. name~=["j"|"e"] matches "john", "jeff", "jack", and "ethan". |
| < | less than |
| <= | less than or equal to |
| > | greater than |
| >= | greater than or equal to |
| |
begin | string | No | The beginning time of the data entries. The format follows RFC3339. | |
end | string | No | The end time of the data entries. The format follows RFC3339. | |
floorId | integer | No | Specify floor ID to search target objects to count the number of objects in the area. | |
searchKeyPrefixes | string | No | A comma-delimited list of search keys. If you specify searchKeyPrefixes, the system will retrieve all location data that has a searchKey beginning with this prefix. For example, if you specify searchKeyPrefixes as "foo::", objects with searchKey such as "foo::bar" and "foo::bazz" will be returned.
|
Responses
200 The requested counted data entries are returned.
Content type: application/json
| Property | Type | Required | Constraints | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
collectionId | string | Yes | read-only (server-generated) | Identifier of the GeoTSDB collection. | |||||||||||||||
data | array<object> | Yes | read-only (server-generated) | The array of count data per area. | |||||||||||||||
| |||||||||||||||||||
timestamp | string | Yes | read-only (server-generated) | Time in RFC3339 format. | |||||||||||||||
Response example
{
"collectionId": "california",
"data": [
{
"areaId": "sfo_office",
"count": 32
}
],
"timestamp": "2023-03-25T09:00:00+09:00"
}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 Any requested object counted 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. |