Serial Number Webhook API

The webhook API can be used to invoke cloud-based actions from a PLT test plan, for example for serial number allocation or provisioning of a DUT.

Webhook Request payload

The configured webhook endpoint will be sent an HTTP POST request containing a JSON payload like below:

JSON payload for HTTP POST request
    "dut_id": "<DUT IDENTIFIER>",
    "ble_mac": "<BLE MAC>",
    "mcu_id": "<MCU ID>",
    "MYCUSTOMKEY": "my custom value"

For security reasons, you probably want to limit requests to those coming from PLTcloud. This can be accomplished by setting an authentication token, and validate the X-Hub-Signature header sent in the webhook request.

The X-Hub-Signature header contains a SHA-1 HMAC hex digest of the webhook payload, using the webhook’s authentication token as the key and prefixed with sha1=. The way you verify this signature varies, depending on the language of your code base.

Webhook Response

The API endpoint should return something like:

JSON payload for HTTP POST response
    "serial_number": "<SERIAL NUMBER>"