Managing devices
Most of the device-related resources are available without authorization.
Get a device ID
Note
Parameter withProperties=true
can be added to the URL to extend the response with additional information.
curl https://cloud.bitbar.com/api/devices/ID
Response body
{ "id": 40941, "selfURI": null, "creditsPrice": 1, "displayName": "Apple iPhone 12 A2403 14.6", "frame100Url": "https://cloud.bitbar.com/resources/images/devices/apple_iphone_xs-h100.png", "frame160Url": "https://cloud.bitbar.com/resources/images/devices/apple_iphone_xs-h160.png", "frame400Url": "https://cloud.bitbar.com/resources/images/devices/apple_iphone_xs-h400.png", "frame80Url": "https://cloud.bitbar.com/resources/images/devices/apple_iphone_xs-h80.png", "frameExtraWidth": null, "imageHeight": 368, "imageLeft": 42, "imagePrefix": "apple_iphone_xs", "imageTop": 27, "imageWidth": 170, "manufacturer": null, "locked": false, "online": true, "osType": "IOS", "platform": "IOS", "softwareVersion": { "id": null, "selfURI": null, "apiLevel": 0, "releaseVersion": "14.6" }, "enabled": true, "accountId": null, "mainUserEmail": null, "properties": null, "deviceGroupOrigin": null, "available": false, "supportedCreators": null }
List all devices IDs
curl https://cloud.bitbar.com/api/devices
Response body
{ "selfURI": null, "data": [ { "id": 854, "selfURI": null, "creditsPrice": 1, "displayName": "Samsung Galaxy Note 3 SM-N900V", "frame100Url": "https://cloud.bitbar.com/resources/images/devices/samsung-galaxy-note3-sm-n9005-h100.png", "frame160Url": "https://cloud.bitbar.com/resources/images/devices/samsung-galaxy-note3-sm-n9005-h160.png", "frame400Url": "https://cloud.bitbar.com/resources/images/devices/samsung-galaxy-note3-sm-n9005-h400.png", "frame80Url": "https://cloud.bitbar.com/resources/images/devices/samsung-galaxy-note3-sm-n9005-h80.png", "frameExtraWidth": null, "imageHeight": 338, "imageLeft": 29, "imagePrefix": "samsung-galaxy-note3-sm-n9005", "imageTop": 34, "imageWidth": 192, "manufacturer": "samsung", "locked": false, "online": true, "osType": "ANDROID", "platform": "ANDROID", "softwareVersion": { "id": null, "selfURI": null, "apiLevel": 21, "releaseVersion": "5.0" }, "enabled": true, "accountId": null, "mainUserEmail": null, "properties": null, "deviceGroupOrigin": null, "available": false, "supportedCreators": null }, (...) ], "limit": 20, "next": "https://cloud.bitbar.com/api/v2/devices?offset=20&limit=20&search=&sort=&filter=enabled_EQ_true;device.archiveTime_ISNULL", "offset": 0, "previous": null, "search": "", "sort": "", "total": 227, "empty": false }
Get device properties
curl https://cloud.bitbar.com/api/devices/ID/properties
Response body
{ "selfURI": null, "data": [ { "id": 641560, "selfURI": null, "displayName": "12 megapixels", "name": "campera-12", "propertyGroupId": 12, "propertyGroupName": "Camera", "labelGroupName": "camera" }, { "id": 32791231, "selfURI": null, "displayName": "iOS devices", "name": "ios-devices", "propertyGroupId": 32707010, "propertyGroupName": "Device groups", "labelGroupName": "device-groups" }, (...) ], "limit": 20, "next": "https://cloud.bitbar.com/api/v2/devices/40941/properties?offset=20&limit=20&search=&sort=&filter=", "offset": 0, "previous": null, "search": "", "sort": "", "total": 22, "empty": false }
Filter devices
Get all device filters
Note
This is especially useful for dynamic device groups.
curl https://cloud.bitbar.com/api/devices/filters
Response body
{ "id": null, "selfURI": null, "deviceFilterGroups": [ { "id": 32707010, "selfURI": null, "name": "Device groups", "deviceFilters": [ { "id": 32707020, "selfURI": null, "name": "android-devices", "displayName": "Android devices", "hidden": false, "osType": "ANDROID" }, { "id": 32791231, "selfURI": null, "name": "ios-devices", "displayName": "iOS devices", "hidden": false, "osType": "IOS" }, { "id": 136405161, "selfURI": null, "name": "trial-devices", "displayName": "Trial devices", "hidden": false, "osType": "UNDEFINED" } ] }, (...) ] }
Exclude a device filter group
Use the name_notlike
filter parameter to exclude the specified device filter group from the query result.
The example below shows how to filter devices and exclude the Supported frameworks filter group from the response.
curl -u <api-key>: https://cloud.bitbar.com/api/v2/devices/filters?limit=0&filter=deviceFilterGroup.name_notlike_Supported%20frameworks
Set a device timeout
Important
This operation requires authorization.
The testTimeLimit
parameter sets a timeout to the specified device.
curl -X POST https://cloud.bitbar.com/api/v2/admin/devices/{deviceId}?testTimeLimit=7200