Device.register

Description

Registers a new device with Lhings. Used to tell Lhings that a new device has been created. Upon succesful creation, Lhings will return the uuid of the newly created device. The device will belong to the account which API Key was used to authenticate the request.

Request specification

  • Method: POST
  • URL: /devices/

Example Request

  • Request URL: https://www.lhings.com/laas/api/v1/devices/
  • Request headers: X-Api-Key: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee Content-Type: application/json

  • Request method: POST

  • Request body:
    { "name": "deviceName", "value": "My device name"}

Example Response

  • HTTP status: 200 OK
  • Response body:
    {"uuid":"598f0dcc-2fb4-446a-8a1d-3a2c278a0a50","name":"My device name"}

Error summary

  • 200: success.
  • 400: bad request. Either request body was not formatted as expected, or a device with the given name already exists for this account.
  • 401: Api key not provided or invalid.
Back to top