HTTP Server config

Hi,

I have just added an endpoint to the asset REST API so you can PUT multiple attributes in one call (any manager docker image with a created date after this post will have this functionality in it):

PUT: /api/{realm}/asset/attributes (Payload = AttributeState[])

Payload example for 2 attributes, one called notes and the other roomNumber:

[
  {
    "ref": {
      "id": "60hocrKYlcvseEqn6vGZlu",
      "name": "notes"
    },
    "value": "test"
  },
  {
    "ref": {
      "id": "60hocrKYlcvseEqn6vGZlu",
      "name": "roomNumber"
    },
    "value": 123
  }
]

You will get a 200 response with the response body being of type AttributeWriteResult[] where AttributeWriteResult is:

{
  "ref": {
     "id": "ASSET_ID",
     "name": "ATTRIBUTE_NAME"
   },
   "failure": "FAILURE REASON"
}

Where failure key will only be present if a problem was encountered writing that attribute's value with the value corresponding to one of the AttributeWriteFailure enum values.

This allows you to determine whether each write was successful or not.

1 Like