Returns a list of all groups belonging to an account as per the specified criteria. This API is paginated and returns 20 groups by default. A group is uniquely identified by a 'group_key'. This key should be used in all the other API referencing a particular group.
Param name | Description |
---|---|
page optional |
Page number of results to be fetched, Default 1 Value: Must be Integer. |
per optional |
Number of group records to be returned in one page, Default 20 Value: Must be Integer. |
order_by optional |
Field on which resultant group records should be sorted Value: Must be a String |
order optional |
Order, “asc” or “desc”, in which results should be sorted Value: Must be a String |
timestamp_format optional |
Format, “str” or “int”, in which timestamps of the group records should be returned, Default “int” Value: Must be a String |
search optional |
Keywords based on which groups should be searched. Currently you can search groups on - group_key, name or tag Value: Must be a String |
scope optional |
Matching condition if multiple keywords are specified for search. Valid values are “all” or “any”. Default is “all” Value: Must be a String |
pretty optional |
Return a pretty formatted response if true, Default is false Value: Must be a Boolean |
field_list optional |
List of fields required in the result. Value: Must be an array of any type |
Request - listing all groups without any criteria curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:-Jt7v9qpdq8Ivi1WwQ6_iQ" https://api.datonis.io/api/v2/groups Response (returns first 20 records) { "total_count": 4, "page": 1, "groups": [ { "created_at": 1428569250, "updated_at": 1417064371, "description": "", "group_key": "8tt9t7dde4", "name": "Energy Meters Single Phase 30Amps", "scope": "all", "tags_array": [ "1-Phase", "30-Amps" ], "tags": "1-Phase,30-Amps" }, { "created_at": 1428569273, "updated_at": 1417064371, "description": "", "group_key": "79t199fa1d", "name": "Energy Meters Single Phase 15Amps", "scope": "all", "tags_array": [ "1-Phase", ...
Request - listing groups by specifying number of groups to be returned at a time (page size) and specific set to be returned (page) curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:-Jt7v9qpdq8Ivi1WwQ6_iQ" -d '{"per":"2","page":"2"}' https://api.datonis.io/api/v2/groups Response (returns page 2 with 2 groups per page) { "total_count": 4, "page": "2", "groups": [ { "created_at": 1428569310, "updated_at": 1417064371, "description": "", "group_key": "t5cet45336", "name": "Energy Meters Three Phase 30Amps", "scope": "all", "tags_array": [ "3-Phase", "30-Amps" ], "tags": "3-Phase,30-Amps" }, { "created_at": 1428569337, "updated_at": 1417064371, "description": "", "group_key": "2abebc5edt", "name": "Energy Meters Three Phase 60Amps", "scope": "all", "tags_array": [ "3-Phase", ...
Request - listing groups ordered by a field with string formatted timestamps curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:-Jt7v9qpdq8Ivi1WwQ6_iQ" -d '{"timestamp_format":"str","order_by":"created_at","order":"desc"}' https://api.datonis.io/api/v2/groups Response (returns groups in the reverse order of time that they were created at with timestamps in string format) { "total_count": 4, "page": 1, "groups": [ { "created_at": "2014/11/26 11:26:42", "updated_at": "2014/11/27 04:59:31", "description": "", "group_key": "2abebc5edt", "name": "Energy Meters Three Phase 60Amps", "scope": "all", "tags_array": [ "3-Phase", "60-Amps" ], "tags": "3-Phase,60-Amps" }, { "created_at": "2015/04/09 08:48:30", "updated_at": "2014/11/27 04:59:31", "description": "", "group_key": "t5cet45336", "name": "Energy Meters Three Phase 30Amps", "scope": "all", ...
Request - listing groups based on some search criteria with all keywords matching curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:-Jt7v9qpdq8Ivi1WwQ6_iQ" -d '{"search":"Single 30Amps"}' https://api.datonis.io/api/v2/groups Response (returns groups containing both keywords 'Single' as well as '30Amps') { "total_count": 1, "page": 1, "groups": [ { "created_at": 1428569250, "updated_at": 1417064371, "description": "", "group_key": "8tt9t7dde4", "name": "Energy Meters Single Phase 30Amps", "scope": "all", "tags_array": [ "1-Phase", "30-Amps" ], "tags": "1-Phase,30-Amps" } ] }
Request - listing groups based on some search criteria with any of the keywords matching curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:-Jt7v9qpdq8Ivi1WwQ6_iQ" -d '{"search":"Single 30Amps", "scope":"any"}' https://api.datonis.io/api/v2/groups Response (returns groups containing either of the keywords 'Single' or '30Amps') { "total_count": 3, "page": 1, "groups": [ { "created_at": 1428569250, "updated_at": 1417064371, "description": "", "group_key": "8tt9t7dde4", "name": "Energy Meters Single Phase 30Amps", "scope": "all", "tags_array": [ "1-Phase", "30-Amps" ], "tags": "1-Phase,30-Amps" }, { "created_at": 1428569273, "updated_at": 1417064371, "description": "", "group_key": "79t199fa1d", "name": "Energy Meters Single Phase 15Amps", "scope": "all", "tags_array": [ "1-Phase", "15-Amps" ], "tags": "1-Phase,15-Amps" }, { "created_at": 1428569310, "updated_at": 1417064371, ...