List Devices
Description
Get a paginated list of all the devices a basestation knows. Administrators can set the query parameter asAdmin to list deleted devices.
The returned list is paginated meaning it may not contain all devices for the product. If additional devices exist, the HTTP link header will contain a next link for getting the next page of devices. If devices exists previous to the returned list, the HTTP link header will contain a prev link for getting the previous page of devices.
Request
GET /v1/n5/products/:productId/devices
Response
Successful response contains the following JSON formated body:
{
productId: string,
deviceId: string,
name: string|null,
batchId: number,
fingerprint: string|null,
created: string,
tags: {
[key: string]: string
},
deleted: boolean
}[]
Response Status codes:
- 200 on success
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:
asAdminIf set, lists Products across organizations. (Only available to admins)deviceIdFilterOnly return Devices matching this filter.limitThe pagination page size. Default: 500. Max 10000.cursorWhere to start the listing. This is used with pagination link headers.
Example
Request
curl "https://api.cloud.nabto.com/v1/n5/products/:productId/devices" \
-H "Authorization: Bearer <ApiKey>" \
-H "X-Nabto-Organization: <OrganizationId>"
Response
[{
"productId": "pr-abcdefgh",
"deviceId": "de-efghijkl",
"name": "friendly name",
"batchId": 42,
"fingerprint": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"created": "2022-10-18T10:17:24.299Z",
"tags": {
"foo": "bar"
},
"deleted": true
},
...]