Navigation

List devices

Summary

Use this API endpoint to get a paginated list of all the unique devices using your project. You can filter this by metadata.

  • path: /proj/devices?filter={"xxx":"yyy"}&whitelisted=false
  • method: GET
  • Base URL: https://api.sabil.io/v2
  • query:
    • per: A number between 1 and 50 indicating how many results you'd like per page.
    • page: The page number you're querying for. Each response will include the current page and the total number of pages, so you can use that to guide your next requests.
    • filter: A JSON string to filter the search. This applies only to the metadata. For example, if you have a metadata boolean flag named 'paid' you can filter by adding {"paid": "true"}.
    • whitelisted: A boolean indicating whether or not to include whitelisted devices in the response. Defaults to false
  • 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 paged list of Device Identity details. Similar to:
    {  "totalDocs": 9,  "limit": 10,  "totalPages": 1,  "page": 1,  "pagingCounter": 1,  "hasPrevPage": false,  "hasNextPage": false,  "prevPage": null,  "nextPage": null,  "docs": [    {      "_id": "6357020903a9763a5a0801e4",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["0nLgxxhPiggfu4iX5hKy42tDdYdGAaXiHw6tLFJwM1M="],      "metadata": {        "paid": "true",        "segment": "local"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 38,      "createdAt": "2022-10-24T21:22:17.114Z",      "updatedAt": "2022-10-31T15:57:28.824Z",      "__v": 0    },    {      "_id": "63570d9c5ebe2dc8283aebe6",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["K91bSt0JGVbEjKSpiWnEni1rzuuEtp3b3PBko60TGVo="],      "metadata": {        "segment": "imaginary",        "test": "true",        "paid": "true"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 1,      "createdAt": "2022-10-24T22:11:40.928Z",      "updatedAt": "2022-10-24T22:11:40.965Z",      "__v": 0    },    {      "_id": "63570d9d5ebe2dc8283aec00",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["lVVlEkbYn67dVf7b552eg0H/pYV2I1V6dcgGQyfEne4="],      "metadata": {        "segment": "onboarded",        "test": "true",        "paid": "true"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 1,      "createdAt": "2022-10-24T22:11:41.044Z",      "updatedAt": "2022-10-24T22:11:41.069Z",      "__v": 0    },    {      "_id": "63570d9d5ebe2dc8283aec59",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["FHjR4wV/O8QtxDW4kkKJH50Ixi7KXVulKBHAMoJDZpk="],      "metadata": {        "segment": "imaginary",        "test": "true",        "paid": "true"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 1,      "createdAt": "2022-10-24T22:11:41.353Z",      "updatedAt": "2022-10-24T22:11:41.386Z",      "__v": 0    },    {      "_id": "63570dd45ebe2dc8283aed62",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["itARSGp68AbHvCrrgrR48TbzweE32xooIibIojZTYK0="],      "metadata": {        "paid": "true",        "segment": "local"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 31,      "createdAt": "2022-10-24T22:12:36.198Z",      "updatedAt": "2022-10-31T14:47:13.123Z",      "__v": 0    },    {      "_id": "635ff066176cfb04e910d093",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["4VSN1ZrQT5TB8aU4mMknoml1zbL58Sw0kNrqkDfLwjc="],      "metadata": {        "paid": "true",        "segment": "local"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 1,      "createdAt": "2022-10-31T15:57:26.065Z",      "updatedAt": "2022-10-31T15:57:26.125Z",      "__v": 0    },    {      "_id": "63652b36aa2cdcd536d2c14b",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["+mSwK9pnntOn1abcyF8/lwnCyVU0SxYJ5J7Tle87HLI="],      "metadata": {        "segment": "onboarded",        "test": "true",        "paid": "true"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 1,      "createdAt": "2022-11-04T15:09:42.861Z",      "updatedAt": "2022-11-04T15:09:42.884Z",      "__v": 0    },    {      "_id": "63652b37aa2cdcd536d2c173",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": ["0XNquM7TSBzgWRS8bcU5eCb7GA6dBswJeE+6HdmzcnE="],      "metadata": {        "segment": "onboarded",        "test": "true",        "paid": "true"      },      "info": {        // ...info      },      "user_count": 1,      "access_count": 1,      "createdAt": "2022-11-04T15:09:43.009Z",      "updatedAt": "2022-11-04T15:09:43.038Z",      "__v": 0    },    {      "_id": "6346dcc7b86d77d230c6a9c1",      "project": "632c919b3c0a10dc53dcaa75",      "fingerprints": [        "/FN0cvuhM5gSCNoJkXDdILErIPphNX61hfgzOSLP94Q=",        "OtohhfaO7q8sjo+GOS+8YQd85BJsPv1r7muPWt4bvig="      ],      "metadata": {        "paid": "true",        "segment": "local"      },      "info": {        // ...info      },      "user_count": 0,      "access_count": 2,      "createdAt": "2022-10-12T15:27:03.010Z",      "updatedAt": "2022-10-12T15:28:11.421Z",      "__v": 0    }  ]}