Documentation Index

Fetch the complete documentation index at: https://documentation.prc-saltillo.com/llms.txt

Use this file to discover all available pages before exploring further.

Webhook Event Buttons

Prev Next

This section explains how the Chat software supports using webhooks with the device. A basic understanding of webhooks and programming skills is required.

Important: The device must be connected to Wi-Fi to use webhooks.

Terms Used in This Section

Term

Meaning

webhook

A webhook is an event that triggers an action.

webhook service/ provider

A webhook service is a web application for retrieving and storing data from a certain event.

webhook event

A webhook event is a web request via a URL that can contain additional information needed by the webhook service/provider.

There are two parts to a webhook event: (1) the URL and (2) the payload in JSON format. The event is the piece that the Chat software sends.

Event example: Create a document

URL

A URL is a website address. For webhooks, a URL is the address sent to trigger an event. Webhooks use the http protocol to communicate with the webhook service/provider.

payload

Additional instructions can be sent with the URL to perform the event. These additional instructions are referred to as a payload.

Note: Not all events need a payload.

Payload examples: Add content to your document (see “webhook event” above); format the content

The webhook service/provider defines the payload. Here's what a small portion of a payload looks like when it's delivered to a webhook service:

{

"event_id": "LtWXD3crgy",

"event_type": "form_response",

"form_response": {

"form_id": "lT4Z3j",

"token": "a3a12ec67a1365927098a606107fac15",

"submitted_at": "2018-01-18T18:17:02Z",

JSON

Webhooks must deliver responses (payloads) in JSON format, a language used by programmers. The Chat software provides an interface for these responses. The example under “payload” above is in JSON format.

placeholder

To simplify creating payloads, the Chat software provides two placeholders: (1) The content of the Speech Display Bar and (2) The button message (shown in the Message box, not the Label box).

Placeholders must appear in these formats: ${SDB} and ${MESSAGE}

The placeholders are not required. You can use either, both, or neither.

Adding a Webhook Event

You can create as many webhook buttons as you want, but you can only specify one URL for each button.

Examples of webhook events: send the latest weather report to your device; trigger a payment; send an alert when something happens; turn on a light; open a door; set a thermostat; operate a smart home device

Note: You can simplify programming webhooks by using ChatEditor, especially copying and pasting URLs and entering data in JSON format.

  1. Select Menu > Edit Mode.

  2. Select and hold the button to which you want to add the webhook event.

  3. Select Edit Button.

  4. Add a label and/or a message and image.

  5. Select the Actions tab.

  6. Select the dropdown menu to open a list of actions.

  7. Select Webhook. A keyboard with a URL prompt opens.

  8. Enter the URL. This can be copied from the webhook service/provider site.

  9. If your event requires a payload, tap below JSON and enter the data in JSON format that you want to send from the button.

    Note: Chat software provides two placeholders: (1) The content of the Speech Display Bar and (2) The message [in the Message box] contained on the button. The placeholders must appear as follows: ${SDB} and ${MESSAGE}

  10. Select Save.

  11. Make sure you have an active Wi-Fi connection and choose the button you created.