REST API

qbee.io has a REST API that allows to access all functionality that is available in the frontend UI. A full REST API description can be found following the link. For your convenience and to enable simple testing a sadnbox option is available for testing API calls.

Below we show you how to use the REST API with some CURL examples.

Sandbox access

On the API page there is a sandbox option that allows to easily extract json information when logged in. This helps to test any query quickly and to extract additional information.

qbee-REST-API

Below we will give some example CURL queries to get you started quickly:

Return inventory list

This shows how to return the full inventory list

curl --digest -u your@mail.com:<your_password> -X  "GET" -H "Content-type: application/x-www-form-urlencoded" https://www.app.qbee.io/api/v2/inventorylist

Set device name, address and location

This CURL call shows how to set a new device name, an address and the location with latitude and longitude.

curl --digest -u your@mail.com:<your_password> -X "PATCH" -d "_format=json&device_name=new+name&city=Oslo&zip=1111&address=Storgata&latitude=60.321&longitude=20.123" -H "Content-type:application/x-www-form-urlencoded" https://www.app.qbee.io/api/v2/deviceattribute/2fa69b10905a2c40b0d2a5d51d1d56517b3f62c28fa631cd3f4129d98543298

Upload a file through the qbee API

This example shows how to upload a file to the qbee file manager.

curl --digest -u YOUR_USER_MAIL:YOUR_PASSWORD -i -X POST -H "Content-Type: multipart/form-data" -F "path=/" -F "file=@README.md" https://www.app.qbee.io/api/v2/file

Delete and upload new file

Assume that you need to replace a key on a device or you want to play out a script or change a configuration. Then you can delete the old file and replace it. If this is part of a file distribution it will automatically be played out again. If a command to run is associated with the file distribution this will run again as well. This means that you could change a file and then this would trigger a recomplation on the device. Or it could be a configuration change and this will trigger a service to be restarted.

Delete file:

curl --digest -u YOUR_USER_MAIL:YOUR_PASSWORD -i -X "DELETE" -d "path=/README.md" -H "Content-type: application/x-www-form-urlencoded" https://www.app.qbee.io/api/v2/file

Upload new file:

curl --digest -u YOUR_USER_MAIL:YOUR_PASSWORD -i -X POST -H "Content-Type: multipart/form-data" -F "path=/" -F "file=@README.md" https://www.app.qbee.io/api/v2/file