Groups
The Groups API allows you to retrieve lists of groups, and lists of devices and datapoints in a group. It also allows you add devices and datapoints to a group, and delete devices and datapoints from a group.
URI Definition
Method | URI and Fields |
GET | /iap/grp |
Returns all groups that current user is permitted to read. This method allows pagination, sorting and filtering by name, though this is optional. Query Parameters
Success ResponseCollection of groups. Example
| |
/iap/grp/{id} | |
Returns a group with the specified ID. Returns nothing if the current user doesn't have permission to read this group. Parameter
Success ResponseGroup with the specified ID. Example
| |
/iap/grp/gz/{id} | |
Returns a collection of groups related to the specified geozone. If flag recursive is set to true also returns all groups related to child geozones for the specified geozone. This method allows pagination, though it is optional. Parameter
Query Parameters
Success ResponseCollection of groups. Example
| |
/iap/grp/count | |
Returns number of groups that matches passed filters. Query Parameters
Success ResponseNumber of groups for the specified filters. Example
| |
PUT | /iap/grp |
Update an already existed group with the specified properties. Query Parameter
Success ResponseUpdated group. Example
| |
/iap/grp/delete | |
.Deletes groups include or exclude the specific IDs. Parameter
Query Parameter
Success ResponseCollection with IDs of deleted groups. Example
| |
/iap/grp/{groupId}/addDevs | |
Adds given devices to the group specified. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
/iap/grp/{groupId}/assign/dev | |
Assigns the specified collection of devices to the specified group. Device can be assigned only to one group at a time, so in order to perform this operation make sure that device is not assigned to some other group. Throws ValidationException if and of devices already assigned to some other group. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
/iap/grp/{groupId}/assign/devs | |
Adds specified devices to the specified group. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
/iap/grp/{groupId}/assign/dp | |
Adds specified datapoints to the specified group. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
/iap/grp/{groupId}/rmDevs | |
Removes specified devices from the specified group. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
/iap/grp/{groupId}/unassign/devs | |
. Parameter
Success ResponseExample
| |
/iap/grp/{groupId}/unassign/dp | |
.Removes specified datapoints from the specified group. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
/iap/grp/getApplicable | |
.Returns set of applicable groups for given devices. So all devices can be assigned on any of returned groups. Query Parameter
Success ResponseCollections of suitable groups. Example
| |
/iap/grp/doImport/{importId} | |
.Takes data from temporary cache by unique ID and moves devices to groups. Parameter
Success ResponseResponse code 200 in case of success or some error code otherwise. Example
| |
POST | /iap/grp |
.Creates new group in the CMS from the specified properties. Query Parameter
Success ResponseCreated group. Example
| |
/iap/grp/import | |
.Pre import stage, parses a CSV file and counts number of devices that will be processed. Saves parsed data into temporary import's cache. Query Parameter
Success ResponseUnique ID of import stage, number of devices which will be assigned to groups and number of devices which will be ignored because they are already in the group. Example
| |
DELETE | /iap/grp/{id} |
.Deletes the specified group from the CMS. Parameter
Success ResponseStatus of performed operation. True in case of success and false otherwise. Example
|
Queries
You can include queries with your IAP/REST request to specify a selection rule for your request. As described in Queries and Parameters, you can specify a query as a query parameter appended to the end of your URI preceded with a "?" character, or as a path parameter within a path element of the path component. The following list describes the optional path parameters for the devices id path element.
Path Parameter | Description |
---|---|
assetTag={tag} | Filters the devices for the specified asset tag |
category={cat} | Filters the devices for the specified category. The value for cat can be edge for edge devices, or sc for segment controllers (edge servers) such as the SmarServer IoT. |
connection={conn} | Filters for devices with the specified connection status. |
description={desc} | Filters the devices for the specified description. |
firmwareVersion={version} | Filters for devices running the specified firmware version number. |
fixtureManufacturer | Filters for devices with the specified manufacturer. |
fixtureModel | Filters for devices with the specified model. |
geozone.description={gz_desc} | Filters the devices for the specified geozone description. |
geozone.id={gz_id} | Filters for devices with the specified geozone ID. |
geozone.name={gz_name} | Filters for devices with the specified geozone name. |
groups.id | Filters for devices with the specified group ID. |
groups.name | Filters for devices with the specified group name. |
health={health} | Filters for devices with the specified health. |
id={dev_id} | Filters for devices with the specified device ID. |
installation_date={date} | Filters for devices with the specified installation date. |
lampType | Filters for devices with the specified lampType. |
lightDistributionType | Filters for devices with the specified lightDistributionType. |
mac | |
name={device_name} | Filters for devices with the specified device name. |
poleType | |
postInstallWattage | |
preInstallWattage | |
ratedLifeHours | |
status={status} | Filters for devices with the specified status. The status values can be provisioned, unprovisioned, provisioning, unprovisioning, or deleted. |
timezone={tz} | Filters for devices installed in the specified timezone. |
type={device_type} | Filters for devices with the specified device type. |
uid={uid} | Filters for devices with the specified unique ID. |
utilityAccountNo | |
utilityRate |
The following list describes the optional path parameters for the block_name path element of the Datapoint Value endpoint:
Path Parameter | Description |
---|---|
type={profile} | Filters for blocks with the specified block type (profile). |
The following list describes the optional path parameters for the datapoint_name path element of the Datapoint Value endpoint:
Path Parameter | Description |
---|---|
lvl_1_interval={log_interval_1} | Filters for datapoints with the specified log interval 1. |
lvl_1_retention={log_retention_1} | Filters for datapoints with the specified log retention period 1. |
lvl_2_interval={log_interval_2} | Filters for datapoints with the specified log interval 2. |
lvl_2_retention={log_retention_2} | Filters for datapoints with the specified log retention period 2. |
lvl_3_interval={log_interval_3} | Filters for datapoints with the specified log interval 3. |
lvl_3_retention={log_retention_3} | Filters for datapoints with the specified log retention period 3. |
name={dp_type} | Filters for datapoints with the specified datapoint type name. |
status={sts} | Filters for datapoints with the specified status. The sts value can be online or offline. |
tag={tag_name} | Filters for datapoints with the specified tag name. |
tag.value={tag_value} | Filters for datapoints with the specified tag value. |
type={dp_type} | Filters for datapoints with the specified datapoint type name. |
The following list describes the optional path parameters for the prop_name path element of the Datapoint Value endpoint:
Path Parameter | Description |
---|---|
name={prop_type} | Filters for properties with the specified property type. |
type={prop_type} | Filters for properties with the specified property type. |
value={prop_value} | Filters for properties with the specified property value. |