POST_edgeDevices

POST /edgeDevices

Posting to this resource is a request to create a link between the Gateway and the targeted edge device using BLE. As a pre-requisite, the scanList resource (see the GET /gateway/scanList Section) must be accessed prior to this. Using the scanList resource forces the Gateway to do an active BLE scan. Posting to this resource is dependent on a previous successful scan, and the target device was included in the scan list. The body of this resource must contain the deviceID JSON tag which specifies the serial number of the intended edge device. This serial number should be the same as was reported from the scanList JSON tag “mainSn”.

NOTES

  1. Linking a device to the Gateway is a lengthy process and a delay must be inserted between the linking operation (after reception of a response from the Gateway to this command) and the sending of another command to the newly linked device. This delay should be at least 10 seconds to account for worst-case conditions and to avoid an error being returned by the Gateway in response to the subsequent command.
  2. This resource is not applicable to the reader-controller.

Authentication

Basic: Unique credentials defined and accepted during setup.

Request

URI Parameters: None

Body: missing the body or should this be None?

Type: application/json

  • deviceId = definition in the ENGAGE - JSON Data Structures document, section titled “Gateway Edge Device Link List”

Request Example:

{"deviceId":"a000000000000123"}

Success Response

HTTP status code: 201

Response Parameters: missing parameters or should this be None?

Type: application/json

  • linkInfo = parent tag (the following terms are defined the ENGAGE - JSON Data Structures document, section titled “Gateway Edge Device Link List”)

    • linkId; deviceId; deviceName; linkCommStatus; modelType

Success Response Example:

{"linkInfo":{"linkId":"dev00001","deviceId":"a000000000000123","deviceName":"Front Door","linkCommStatus":"Connected",
"modelType":"nde"}}

Error Response(s)

HTTP status code: 400

Response parameters: missing parameters or should this be None?

Type: application/json

  • statusMessage = multiple detailed status message, value(s) defined below

    • “Invalid device ID in JSON body” indicates, bad device ID in JSON body. This error response can also be given if the deviceId contained in the body is already liked to the respective Gateway.

HTTP status code: 500

Response parameters: missing parameters or should this be None?

Type: application/json

  • statusMessage = multiple detailed status message, value(s) defined below

    • “Link failed to connect” indicates, request to link to edge device that was not in the “scanList” response.

 

Last Modified: October 14, 2019