Navigation

List users of a device

Summary

Use this API endpoint to get a list of all the users who've used a the device identity.

Device vs. Device Identity Every device has an identity called "Device Identity". Device identities are unique across your project, meaning that no two identities are the same. However, any devices that share the same identity can be assumed to be one physical device.

  • path: /proj/devices/identity/<identity>
  • method: GET
  • Base URL: https://api.sabil.io/v2
  • params:
    • identity: The identity of the device. Be sure to use the identity, not the id.
  • headers:
    • Authorization: Bearer <api_secret>: where secret is the raw API secret you get when generating an API key.

      Never reveal your secret on the client side. Only make this call from a secure server.

  • response: Returns a Device Identity details object. It will contain a list of the users who've used this device (recognized by the identity). Similar to:
    {  "_id": "63570d9d5ebe2dc8283aec17",  "users": [    {      "_id": "63570d9c3b592ae2e879cd71",      "external_id": "ff29c1db-1ad8-4be3-83da-427dbb1b38e0",      "project": "632c919b3c0a10dc53dcaa75",      "__v": 0,      "createdAt": "2022-10-24T22:11:40.828Z",      "metadata": {        "segment": "imaginary",        "test": "true",        "paid": "false"      },      "updatedAt": "2022-10-24T22:11:41.066Z",      "attached_device_count": 3,      "device_count": 3    },    {      "_id": "63570d9d3b592ae2e879cda2",      "external_id": "9d97adfa-1a86-4da8-90e1-1e5bd41a5deb",      "project": "632c919b3c0a10dc53dcaa75",      "__v": 0,      "createdAt": "2022-10-24T22:11:41.116Z",      "metadata": {        "segment": "imaginary",        "test": "true",        "paid": "true"      },      "updatedAt": "2022-10-24T22:11:41.364Z",      "attached_device_count": 2,      "device_count": 3    },    {      "_id": "63570d9d3b592ae2e879cdfc",      "external_id": "e1aa0ff0-4071-4eb8-b1a3-20f5240f6a8f",      "project": "632c919b3c0a10dc53dcaa75",      "__v": 0,      "createdAt": "2022-10-24T22:11:41.705Z",      "updatedAt": "2022-10-24T22:11:41.935Z",      "attached_device_count": 2,      "device_count": 3    },    {      "_id": "63652b36e9a8e03a946c42fa",      "external_id": "8993360b-1d9f-4638-b04b-1d32281924fa",      "project": "632c919b3c0a10dc53dcaa75",      "__v": 0,      "createdAt": "2022-11-04T15:09:42.550Z",      "metadata": {        "segment": "onboarded",        "test": "true",        "paid": "false"      },      "updatedAt": "2022-11-04T15:09:42.882Z",      "attached_device_count": 3,      "device_count": 3    },    {      "_id": "63652b36e9a8e03a946c432b",      "external_id": "2a5bef86-00f9-4817-9df3-484bf666e3ec",      "project": "632c919b3c0a10dc53dcaa75",      "__v": 0,      "createdAt": "2022-11-04T15:09:42.932Z",      "metadata": {        "segment": "onboarded",        "test": "true",        "paid": "false"      },      "updatedAt": "2022-11-04T15:09:43.179Z",      "attached_device_count": 2,      "device_count": 3    }  ],  "user_count": 5,  "access_count": 5}