To retrieve all Devices of a specific Organization please make a GET request to the following URL:
HTTP Method | URL |
---|
GET | https://industrial.api.ubidots.com/api/v2.0/organizations/<organization_key>/devices/ |
Parameter | Type | Description |
---|
organization_key | String | The id or label of the Organization, label should use the prefix ~ |
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 |
variablesCount | Integer | Sort | Sort by the number of variables in the device |
lastActivity | Integer | Sort | Sort by last activity |
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 |
id | String | Filter Attribute | Filter by id |
label | String | Filter Attribute | Filter by label |
name | String | Filter Attribute | Filter by name |
createdAt | String | Filter Attribute | Filter by date of creation |
lastActivity | Integer | Filter Attribute | Filter by lastActivity |
variablesCount | Integer | Filter Attribute | Filter by the number of the variables in the device |
$ curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/organizations/<organization_key>/devices/' \
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "https://industrial.ubidots.com/api/v2.0/devices/631803722c3f16000d6f86e3",
"id": "631803722c3f16000d6f86e3",
"label": "3347",
"name": "3347",
"createdAt": "2022-09-07T02:35:30.497576Z",
"variablesCount": 5,
"lastActivity": 1663335764985
}
]
}
{
"code": 400001,
"message": "Validation Error.",
"detail": {
....
}
}
{
"code": 401001,
"message": "Authentication credentials were not provided.",
"detail": "Authentication credentials were not provided."
}
An object with an array results
containing all Devices of the specific organization.