Get devices that own a list of variables

This request will retrieve the "device" attribute from a list of variable labels.

The below request uses:

  • Dynamic fields: To only retrieve the "device" attribute from the variable that comply with the filter
  • Id filter: label__in=<commaSeparatedTargetLabel>
curl -X GET 'https://industrial.api.ubidots.com/v2.0/variables/?fields=devices&label=<commaSeparatedTargetLabel>' \
-H 'X-Auth-Token: <TOKEN>'

Response:

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "device": {
        "url": "https://industrial.ubidots.com/api/v2.0/devices/662671438b922f6e51876871",
        "id": "662671438b922f6e51876871",
        "label": "demo205",
        "name": "Demo 205",
        "createdAt": "2024-04-22T14:16:35.765622Z"
      }
    },
    {
      "device": {
        "url": "https://industrial.ubidots.com/api/v2.0/devices/66048fa268228216e2338638",
        "id": "66048fa268228216e2338638",
        "label": "demo206",
        "name": "Demo 206",
        "createdAt": "2024-03-27T21:29:06.432113Z"
      }
    }
  ]
}