Get Variable

This endpoints retrieves a specific Variable.

Request

To retrieve a single Variable please make a GET request to the following URL:

HTTP MethodURL
GEThttps://industrial.api.ubidots.com/api/v2.0/variables/<variable_id>/

To retrieve a single Variable of a Device please make a GET request to the following URL:

HTTP MethodURL
GEThttps://industrial.api.ubidots.com/api/v2.0/devices/<device_key>/variables/<variable_key>/

Path Parameters

ParameterTypeDescription
variable_idStringThe id of the Variable

Header

ParameterRequired?Description
X-Auth-HeaderYes[Authentication Token] (/reference/authentication) of account
$ curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/variables/<variable_id>' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'
{
    "createdAt": "2019-12-18T14:38:38.354415Z",
    "syntheticExpression": "",
    "description": "my second variable",
    "device": {
        "id": "6e309da44fc8455a9cceb5aa",
        "label": "first-device",
        "name": "First Device",
"url":"https://industrial.api.ubidots.com/api/v2.0/devices/6e309da44fc8455a9cceb5aa"
    },
    "icon": "pencil",
    "id": "5dfa39ee1a9ca53020c69391",
    "label": "var0",
    "lastActivity": null,
    "lastValue": {},
    "name": "var0",
    "properties": {
        	"any":"thing"
    },
    "tags": ["blue", "yellow"],
    "type": "raw",
    "unit": "meters",
    "url": "https://industrial.api.ubidots.com/api/v2.0/variables/5dfa39ee1a9ca53020c69391",
    "valuesUrl": "https://industrial.api.ubidots.com/api/v1.6/variables/5dfa39ee1a9ca53020c69391/values"
}
Validation error
Authentication credentials were not provided

Response

Returns a Variable object with the requested Variable.