Update a device.

Details

Update a device.

An account token, server token, or user token may be used to run this endpoint.

Parameters

path

  • id (required): The ID of the device.

body

  • alias (optional): The alias associated with the device.
  • services (optional): The names of the services this device implements.
  • meta (optional): The metadata associated with the device.

header

  • x-system-metadata-prefix (optional): A customized metadata prefix. The default is “$.”

Responses

200

400

  • Device Invalid: The standard error structure defines this error as invalid parameters, with an invalid ID. In this context, it means that the ID given for a client is invalid.
  • No Query String Allowed: The standard error structure defines this error as invalid parameters, with additional parameters in the query string. In this context, it means that no query string is allowed at all when calling this endpoint.
  • Alias Exists: The standard error structure defines this error as an invalid body. The error means that an object with the same alias already exists. The best way to avoid this error is to make sure all aliases are unique strings, regardless of where they are accessed from.
  • Alias Invalid: The standard error structure defines this error as invalid parameters. The error means that an alias given for an object is not valid. However, this invalid alias does not necessarily mean that any other object references are invalid. This error refers only to the alias itself.
  • Metadata Format Invalid: The standard error structure defines this error as invalid parameters. In this context, it means that metadata, when specified, should have been formatted as a valid JSON object, and it was not formatted that way.

404

  • Device Not Found: This error means that a device with the given ID was not found. This is distinct from an invalid device ID being specified; this means that the device ID once existed, but no longer does.

Examples

HTTP

PUT https://ioe.droplit.io/api/devices/DEVICE-ID HTTP/1.1
authorization: TOKEN
content-type: application/json
{
    "meta": {},
    "alias": "DEVICE-ALIAS",
    "services": [ "SERVICE-NAME" ]
}

Droplit Console

droplit device update DEVICE-ID PROPERTY-NAME PROPERTY-VALUE

Droplit SDK

droplit.devices.update("DEVICE-ID", { "PROPERTY-NAME" : "PROPERTY-VALUE", ... });

 
Language
Credentials
Header
Click Try It! to start a request and see the response here!