Bosch IoT Device Management - will be discontinued by mid 2024

Manage features via Manager HTTP API

In this step, you will simulate that a business application registers remotely a LED feature and updates its value.

As you might not have drafted your business application yet, use the Device Inventory component of the mass management layer to send the request to your device.


Goal

Create a new feature called LED for your device with ID device your.namespace:hello-world-device-01. Once the feature exist, update it.

Procedure

Navigate to the API docs

Go to Bosch IoT Manager > Devices and find the method PUT/di​/devices​/{deviceId}​/features.

Authorize

Click images/confluence/download/thumbnails/1647788999/Authorize-button.png in the top right area of the screen or the similar icon to the right of the respective method in order to get a pop-up offering basic authentication.

In this example, you will mimic the remote management UI hello-world-device. Therefore, please authenticate with a Suite Auth token (the same as you created during Provisioning via Device Provisioning API).

images/confluence/download/attachments/1647788999/auth-manager-apidocs.png

Close the pop-up.

Create the new feature

  • Go back to the method PUT/di​/devices​/{deviceId}​/features

  • Click Try it out to get access to the input fields.

images/confluence/download/attachments/1647788999/Device-Features-via-API.png

  • In the deviceId field set the full name of your device, e.g. your-namespace:hello-world-device-01

  • In the Request body, paste the information from the code block below.
    It is based on an already defined Vorto model of the LED feature which describes its functionalities.

    {
    "id": "LED",
    "definitions": [
    {
    "namespace": "com.bosch.iot.suite.example.octopussuiteedition",
    "name": "LED",
    "version": "1.0.0",
    "fullyQualifiedIdentifier": "com.bosch.iot.suite.example.octopussuiteedition:LED:1.0.0"
    }
    ],
    "properties": [
    {
    "id": "currentColor",
    "category": "status",
    "value": {
    "r": 0,
    "g": 0,
    "b": 0
    }
    }
    ],
    "desiredProperties": []
    }
  • Click Execute.
    A response code of 204 will indicate success.


Check your work

Execute a GET request to check the newly created feature.

Navigate to GET/di​/devices​/{deviceId}​/features, click Try it out, enter the deviceId as above, and then click Execute.

The successful response should list all existing features of this device.

Alternatively, you can also check the Bosch IoT Suite Console.
In the left navigation open the Things, select the device on the list and open the Features blade where you should see the newly created feature.

images/confluence/download/attachments/1647788999/LED-feature-Developer-Console-view.png

Update the feature

With a similar PUT request as you used for creating the feature, you can also update it.

Follow the same steps as described above for creating the feature but enter a different value of the defined property and confirm with Execute.

To check the applied change, execute a GET request on the device features (GET/di​/devices​/{deviceId}​/features) or use the Bosch IoT Suite UI.

Tips for debugging

Please check if the change has been applied.

  • In case of error, please check if you have provided correct format and values in each of the fields.

  • Your authentication might have expired in the meantime, as the token is only valid one hour.
    Create a new token and copy it into the bearer auth authorization field.