All Variables
To retrieve all the variables for a device, please make a GET request to the following URL: https://cs.api.ubidots.com/api/v2.0/devices//variables/
Example: https://cs.api.ubidots.com/api/v2.0/devices/61fc258dd4ffae5290231519/variables/
| Parameter | Type | Use | Description |
|---|---|---|---|
| token | String | Authentication | Authentication Token can optionally be sent as a query parameter. |
| page | Number | Pagination | Returns the corresponding page of the result |
| page_size | Number | Pagination | Number of items per page, if not provided takes default values of 50 (for variables 200) |
| createdAt | String | Sort | Sort all Variables based on date created. Default descending. |
| label | String | Sort | Sort by label |
| name | String | Sort | Sort by name |
| fields | Comma separated list | Dynamic Fields | Specify the fields that should be obtained in the response object. |
| search | String | Search | Allows to search on the following fields with one request label, name, description, username, firstName, lastName |
| id | String | Filter | Filter by id |
| label | String | Filter | Filter by label |
| name | String | Filter | Filter by name |
| description | String | filter | filter by properties |
| tags | Array | Filter | Filter by tags |
| createdAt | Date | Filter | Filter by date created |
| properties | JSON | Filter | Filter by properties |
| unit | String | Filter | Filter by unit |
| device | Related Device Filter | Related Filter | Filter by Related Device Filter (device____) |
| lastActivity | Integer | Filter | Filter by last activity |
Single Variable
To retrieve a single Variable please make a GET request to the following URL: https://cs.api.ubidots.com/api/v2.0/variables//
To retrieve a single Variable of a Device please make a GET request to the following URL: https://cs.api.ubidots.com/api/v2.0/devices//variables//
Example:
https://cs.api.ubidots.com/api/v2.0/devices/61fc258dd4ffae5290231519/variables/test-device/
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| variable_id | String | ID of Variable |
Query Parameters
| Parameter | Type | Use | Description |
|---|---|---|---|
| fields | Comma separated list | Dynamic Fields | Specify the fields that should be obtained in the response object |
Header
| Parameter | Required? | Description |
|---|---|---|
| X-Auth-Header | Yes | Authentication Token of account |