List all endpoints for a group

The list all endpoint for a group request allows the client applications to retrieve a list of all registered and deregistered device serial numbers by specifying the startOffset and endOffset values. It also allows the client application to retrieve the count of all devices by setting the startOffset and endOffset values to 0.

If fetchAll parameter is set to true, the application retrieves all the devices (registered, deregistered and unregistered). By default, fetchAll parameter is set to false. If it is left unchanged, the application retrieves the device serial numbers that are attached to a particular group.

To use this API, the user must have access to the devices of the specified group.

List all endpoints for a group describes the API structure for List Endpoints requests.

Table 1. List all endpoints for a group
Title List all endpoints for a group
URL

http://<impact_url>/m2m/endpoints?startOffset=<>&endOffset=<>&groupName=<>&fetchAll=true

Method GET
Content-Type application/json
URL Params

The URL parameters are:

  • startOffset:[integer]: Offset specifying the 1st element of the endpoints list to retrieve.

  • endOffset:[integer]: Offset specifying the last element of the endpoints list to retrieve.

  • groupName:[string]: Specifies the name of the IMPACT IoT group for retrieving the list of all endpoints or total count of all endpoints.

Data Params

None

Success Code
Response Code: 200
Error Code
401 : Unauthorized 
403 : Forbidden 
404 : Not Found
Sample Call Curl command for fetchAll is true
curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' 
'http://<impact_url>/m2m/endpoints?startOffset=1&endOffset=2&groupName=<>&fetchAll=true'
Response Body:
{
  "totalDevices": 10,
  "groupName": "LWM2MNOV2",
  "startOffset": 1,
  "endOffset": 10,
  "directEndPoints": [Array[1]
    -0: {
        "totalDevices": 10,
        -"serialNumbers": [Array[10]
            0: "4000"
            1: "VIRTUAL_GATEWAY_COAP9"
            2: "urn:imei:1234560000"
            3: "urn:imei:1234560001"
            4: "urn:imei:1234560002"
            5: "urn:imei:1234560003"
            6: "urn:imei:1234560004"
            7: "urn:imei:1234560005"
            8: "urn:imei:1234560006"
            9: "urn:imei:1234560007"
      ],
    }
  ],
}
Curl command for fetchAll is false
curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' 
'http://<impact_url>/m2m/endpoints?startOffset=1&endOffset=2&groupName=<>&fetchAll=false'
Response Body:
{
  "totalDevices": 2,
  "groupName": "DM.MFORM",
  "startOffset": 1,
  "endOffset": 2,
  "directEndPoints": [
    {
      "impactGWId": "636768662991367",
      "serialNumbers": [
        "250831",
        "US:822P454511"
      ]
    }
  ]
}
Notes

With this request, client applications can also retrieve the total number of devices present in a group by setting the startOffset and endOffset parameters to 0. In this case, IMPACT IoT does not return any device serial number.

Example:

{
  "totalDevices": 31,
  "groupName": "manas",
  "startOffset": 0,
  "endOffset": 0
}