Update

Update a device record

Update a device in the Meshblu device registry. In order to update a target device, your connection must be authenticated as a device that is in the target device's configure.update whitelist. See the Meshblu whitelist documentation for more information.

Event: "update", query, callback

  • query/update Both the query and update object. Must contain at least a uuid. Other than the listed exceptions, all other parameters will overwrite the device in the registry.
    • uuid UUID of the device to update. If omitted, it defaults to the UUID of the authenticated connection.
  • callback Function that will be called with a result.
    • result Object passed to the callback.
      • uuid The uuid of the device that was updated.
      • status Status code of the update operation. Will always be 200, even if the update did not happen.

❗️

Risk of Overwrite

v1.0 of update does not allow for atomic updates using the '$' prefix operators. This means you may run into the classic Read Write race condition. See the HTTP or XMPP APIs if you need of that functionality.

Successful Response

{
  "uuid": "78159106-41ca-4022-95e8-2511695ce64c",
  "status": 200
}

Error Response

{
  "uuid": "i-made-this-uuid-up",
  "status": 200
}