Managing devices and device groups

Devices

Note: Most of the device related resources are available without authorization

Getting device

Note: Parameter withProperties=true can be added to the url to extend response of additional information

curl https://cloud.bitbar.com/api/devices/ID

Listing all devices

curl https://cloud.bitbar.com/api/devices

Getting device properties

curl https://cloud.bitbar.com/api/devices/ID/properties

Getting all device filters

Note: This is especially useful for dynamic device groups.

curl https://cloud.bitbar.com/api/devices/filters

Device groups

Device groups can be based on devices and/or device filters(selectors). Devices can be added statically (adding device to device group by device ids) or dynamically (adding selector to device group by selector ids).

Creating device group

Note: Parameter osType is optional. Default value: ANDROID.

curl -X POST -u <api-key>: https://cloud.bitbar.com/api/me/device-groups -d 'displayName=NAME'

Getting device group

curl -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID

Listing all device groups

curl -u <api-key>: https://cloud.bitbar.com/api/me/device-groups

Deleting device group

curl -X DELETE -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID

Updating device group

Note: All of the parameters are optional.

curl -X POST -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID -d "displayName=NAME&osType=IOS"

Device group devices and selectors

Adding device to device group

Note: Resource accepts deviceIds[] for adding multiple devices with single API call.

curl -X POST -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID/devices -d "deviceId=DEVICE_ID"

Deleting device from device group

curl -X DELETE -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID/devices/DEVICE_ID

Adding selector to device group

Note: Resource accepts multiple selectors to add them with single API call.

curl -X POST -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID/selectors -d "selectorIds[]=SELECTOR_ID"

Deleting selector from device group

curl -X DELETE -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID/selectors/SELECTOR_ID

Getting device group devices

Note: Resource contains all devices added statically deviceGroupOrigin has value STATIC, all devices added dynamically deviceGroupOrigin has value DYNAMIC (device is on the list because it has selector which was added to the group) or devices added both ways deviceGroupOrigin has value HYBRID (device is on the list because it has selector added to the group while device id was added to the group as well)

curl -u <api-key>: https://cloud.bitbar.com/api/me/device-groups/ID/devices