Dynamic Fields

All data retrieved from the Ubidots API v2.0 can be dynamically selected or omitted, i.e. it's possible to select just the fields that are required, or omit certain fields.

To use dynamic fields just add the appropriate field to the query parameter fields as a comma-separated list in order to receive just the desired fields.
If you want to omit one or more specific fields add omit as query parameter. All fields specified in the comma-separated list are then omitted in the response.

🚧

What fields can I select?

All fields of the object within the results key can be selected. In other words, all parameters of the Entity Object.

GET https://industrial.api.ubidots.com/api/v2.0/variables/?fields=label,type

//Returns Array 'results' with all variables but only with their label and type
{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "label": "precipitation",
            "type": "raw"
        },
        {
            "label": "temperature",
            "type": "raw"
        },
        {
            "label": "average_temperature",
            "type": "synthetic"
        }
    ]
}
GET https://industrial.api.ubidots.com/api/v2.0/variables/?omit=createdAt,description,device,lastActivity,lastValue,properties,syntheticExpression,tags,unit,url,valuesUrl,id,name

//Returns Array 'results' with all variables but only with their label and type
{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "label": "precipitation",
            "type": "raw"
        },
        {
            "label": "temperature",
            "type": "raw"
        },
        {
            "label": "average_temperature",
            "type": "synthetic"
        }
    ]
}