Devices

Activate Device to a Product

POST /api/devices/{device_id}/activate

If a device based on a compatible platform, is unlocked, and the device has access to the appropriate flavor, platform and product product, the device can be activated to become that product. Once activated, the device must perform an OTA to receive the firmware bundle for the new product.

Parameters

propertytypedescriptionexample
device_idid_or_uuidid or uuid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
product_idid requiredID of the Product to activate to1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"product_id":"1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1"}' http://localhost:2002/api/devices/{device_id}/activate

Delete Device CloudFS file

DELETE /api/devices/{device_id}/files/{path*}

Parameters

propertytypedescriptionexample
device_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X DELETE -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{device_id}/files/{path*}

Get a CloudFS file

GET /api/devices/{device_id}/files/{path*}

Parameters

propertytypedescriptionexample
device_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{device_id}/files/{path*}

Index Device CloudFS files

GET /api/devices/{device_id}/files

Parameters

propertytypedescriptionexample
device_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{device_id}/files

Upload a CloudFS file

POST /api/devices/{device_id}/files/{path*}

Parameters

propertytypedescriptionexample
device_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{device_id}/files/{path*}

Get filtered list of devices

GET /api/devices

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices

Get a Device

GET /api/devices/{identifier}

Parameters

propertytypedescriptionexample
identifierdevice_id_uuid_or_mac_addrDevice_id, UUID, Mac Addr or BT Addr1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{identifier}

Perform OTA on behalf of BLE device.

POST /api/devices/{device_id}/ota

Parameters

propertytypedescriptionexample
device_ididdevice_id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
bididOptionally indicate currently installed bundle1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1
bundle_ididRequest specific bundle. Must be published bundle on product device is activated to.1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"bid":"1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1","bundle_id":"1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1"}' http://localhost:2002/api/devices/{device_id}/ota

Report bundle version BLE Device is running after OTA

POST /api/devices/{device_id}/ota/result

Parameters

propertytypedescriptionexample
device_ididdevice_id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
bundle_idid requiredid of bundle device successfully OTAd to1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"bundle_id":"1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1"}' http://localhost:2002/api/devices/{device_id}/ota/result

Get Products that Device Owner can activate Device to

GET /api/devices/{id}/products

Parameters

propertytypedescriptionexample
idid_or_uuidid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{id}/products

Provision a new Device

POST /api/devices/provision

Payload

propertytypedescriptionexample
uuiddevice_uuid requiredHardware UUID of new device to provision0000000000000000000000000000000000000000
platform_idid requiredID of the Platform for the new the Device1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"uuid":"0000000000000000000000000000000000000000","platform_id":"1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1"}' http://localhost:2002/api/devices/provision

Factory Reset claimable device

POST /api/devices/{device_id}/reset

Parameters

propertytypedescriptionexample
device_idid_or_uuidid or uuid0000000000000000000000000000000000000000

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/devices/{device_id}/reset

Update a Device

PUT /api/devices/{device_id}

Parameters

propertytypedescriptionexample
device_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
titlestringTitle of DeviceMy Device
descriptionstringDescriptive of DeviceMy Device

Curl Example

curl -v -X PUT -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"title":"My Device","description":"My Device"}' http://localhost:2002/api/devices/{device_id}

Set Device Tag

POST /api/devices/{device_id}/tag

Parameters

propertytypedescriptionexample
device_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
tagstring requiredWhich Bundle Tag the Device should OTA torelease

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"tag":"release"}' http://localhost:2002/api/devices/{device_id}/tag