List Active Devices

Description

List the devices of a product that were active in a calendar month: those that connected at some point in the month, as counted for billing. Use it to check which devices are behind the monthly active device count. The returned list is paginated by device id. If additional devices exist, the HTTP link header will contain a next link for getting the next page. If devices exist before the returned list, the HTTP link header will contain a prev link for getting the previous page.

Request

GET /v1/webrtc/products/:productId/active-devices

Response

Successful response contains the following JSON formated body:

{
  month: string,
  devices: {
    deviceId: string,
    firstSeen: string,
    lastSeen: string
  }[]
}

Response Status codes:

  • 200 on success

  • 400 for a month not of the form YYYY-MM

Request headers

This request must have the following headers:

  • Authorization: bearer <ApiKey>
  • X-Nabto-Organization: <organizationId>

Request Query Parameters

This request supports the following query parameters:

  • month The calendar month, YYYY-MM (UTC). Default: the current month.
  • deviceIdFilter Only return devices whose id contains this text.
  • limit The pagination page size. Default: 500. Max 10000.
  • cursor Where to start the listing. This is used with pagination link headers.

Example

Request

curl "https://api.cloud.nabto.com/v1/webrtc/products/:productId/active-devices" \
  -H "Authorization: Bearer <ApiKey>" \
  -H "X-Nabto-Organization: <OrganizationId>"

Response

{
   "month": "<month>",
  "devices": [{
     "deviceId": "a.mydomain.example.net",
    "firstSeen": "<firstSeen>",
    "lastSeen": "<lastSeen>" 
  },
  ...],
  
}