API operation to get the device count in the specified area during a certain time interval.
client.regiondevicecount.getCount(RegiondevicecountGetCountParams { area, endtime, filter, 4 more } params, RequestOptionsoptions?): RegiondevicecountGetCountResponse { count, status }
POST/regiondevicecount/count
Get the number of devices in the specified area during a certain time interval.
- The query area can be a circle or a polygon composed of longitude and latitude points.
- If the areaType is circle, the circleCenter and circleRadius must be provided; if the area is a polygon, the point list must be provided.
- If starttime and endtime are not passed in,this api should return the current number of devices in the area.
- If the device appears in the specified area at least once during the certain time interval, it should be counted.
API operation to get the device count in the specified area during a certain time interval.
import Camara from 'camara-sdk';
const client = new Camara({
bearerToken: process.env['CAMARA_BEARER_TOKEN'], // This is the default and can be omitted
});
const response = await client.regiondevicecount.getCount({
area: { areaType: 'CIRCLE' },
endtime: '2023-07-04T14:27:08.312+02:00',
filter: { roamingStatus: ['roaming'], deviceType: ['human device', 'IoT device'] },
sink: 'https://endpoint.example.com/sink',
sinkCredential: { credentialType: 'ACCESSTOKEN' },
starttime: '2023-07-03T14:27:08.312+02:00',
});
console.log(response.count);{
"count": 100,
"status": "SUPPORTED_AREA"
}{
"count": 100,
"status": "PART_OF_AREA_NOT_SUPPORTED"
}{
"status": "AREA_NOT_SUPPORTED"
}{
"status": "DENSITY_BELOW_PRIVACY_THRESHOLD"
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Client specified an invalid argument, request body or query param."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.TIME_INVALID_ARGUMENT",
"message": "starttime and endtime cannot be passed separately. Either both are passed or neither is passed."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.INVALID_END_DATE",
"message": "Indicated endTime is earlier than the startTime."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.INVALID_CIRCLE_AREA",
"message": "Missing circle center or radius."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.INVALID_POLYGON_AREA",
"message": "The area is not a polygon shape or has an arbitrary complexity."
}{
"status": 400,
"code": "INVALID_CREDENTIAL",
"message": "Only Access token is supported"
}{
"status": 400,
"code": "INVALID_TOKEN",
"message": "Only bearer token is supported"
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.UNSUPPORTED_SYNC_RESPONSE",
"message": "Indicated combination of area or time interval is too big for a sync response"
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.UNSUPPPORTED_REQUEST",
"message": "Indicated combination of area or time interval is too big"
}{
"status": 401,
"code": "UNAUTHENTICATED",
"message": "Request not authenticated due to missing, invalid, or expired credentials."
}{
"status": 403,
"code": "PERMISSION_DENIED",
"message": "Client does not have sufficient permissions to perform this action."
}{
"status": 403,
"code": "INVALID_TOKEN_CONTEXT",
"message": "{{field}} is not consistent with access token."
}{
"status": 429,
"code": "QUOTA_EXCEEDED",
"message": "Out of resource quota."
}{
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit reached."
}Returns Examples
{
"count": 100,
"status": "SUPPORTED_AREA"
}{
"count": 100,
"status": "PART_OF_AREA_NOT_SUPPORTED"
}{
"status": "AREA_NOT_SUPPORTED"
}{
"status": "DENSITY_BELOW_PRIVACY_THRESHOLD"
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Client specified an invalid argument, request body or query param."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.TIME_INVALID_ARGUMENT",
"message": "starttime and endtime cannot be passed separately. Either both are passed or neither is passed."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.INVALID_END_DATE",
"message": "Indicated endTime is earlier than the startTime."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.INVALID_CIRCLE_AREA",
"message": "Missing circle center or radius."
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.INVALID_POLYGON_AREA",
"message": "The area is not a polygon shape or has an arbitrary complexity."
}{
"status": 400,
"code": "INVALID_CREDENTIAL",
"message": "Only Access token is supported"
}{
"status": 400,
"code": "INVALID_TOKEN",
"message": "Only bearer token is supported"
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.UNSUPPORTED_SYNC_RESPONSE",
"message": "Indicated combination of area or time interval is too big for a sync response"
}{
"status": 400,
"code": "REGION_DEVICE_COUNT.UNSUPPPORTED_REQUEST",
"message": "Indicated combination of area or time interval is too big"
}{
"status": 401,
"code": "UNAUTHENTICATED",
"message": "Request not authenticated due to missing, invalid, or expired credentials."
}{
"status": 403,
"code": "PERMISSION_DENIED",
"message": "Client does not have sufficient permissions to perform this action."
}{
"status": 403,
"code": "INVALID_TOKEN_CONTEXT",
"message": "{{field}} is not consistent with access token."
}{
"status": 429,
"code": "QUOTA_EXCEEDED",
"message": "Out of resource quota."
}{
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit reached."
}