Is it possible to add Device Cloud tags via RCI or some other API?


I have an operation that updates our custom python code. Is it possible to set a tag on the device similar to how it is done through the GUI? We’d like to tag the device with our version, such as v1.0.11.

Yes. This is commonly done with the device description field:

  New Python Version: x.x.x

You can use the /v1/devices/inventory API to set the tags on a device.

For example, an HTTP PUT to /ws/v1/devices/inventory/00000000-00000000-00409DFF-00000000

with payload

  "tags" : [ "first tag", "second tag" ]

will set two tags for that particular device.

If you prefer XML you can use the following (or set the Accept header to application/xml).

HTTP PUT to /ws/v1/devices/inventory/00000000-00000000-00409DFF-00000000.xml with payload

      first tag
      second tag

Both of the above will replace any existing tags. There is currently no way to simply add a new tag. You can check out some other examples in the programming guide under v1/devices (