Call a webhook from an automation bot as described in the following sections:
Workspace AppSheet Core security violation
error, then the use of this feature is not allowed by policy, as described in Set the AppSheet Core security setting. Contact your Workspace administrator for assistance.Add and configure the Call a webhook task
Add and configure the Call a webhook task by performing the following steps:
- Add the Call a webhook task to a bot, as described in Add a task to a bot.
- Configure the Call a webhook task by setting the properties described in the following tables.
- When you are done, save the app by selecting one of the following:
- Save - Save the app.
- Save & verify data - Save the app and verify that it is runnable based on external dependencies.
After you save the app, you can reuse task in other bots.
Configure the Call a webhook task by using the settings described in the following tables.
Setting |
Description |
Linking |
Enable or disable the reuse of this component by expanding the Linking panel and toggling the Linking setting. See Reuse automation components.
|
Task name |
Name of the task. It must be unique within your app.
Note: This setting is available only if Linking is turned on.
|
Table name |
Table defined in the event and used by the task. To view or edit the structure of the selected table, position your cursor in the field and click . See Tables: The Essentials for more information. Note: To use a table that is different from the table defined in the event, add a Call a process step. |
Preset |
Customize all settings or select a preset to pre-populate a subset of values. Valid values include:
|
Url |
URL of the web service for the HTTP request. The URL must be absolute and may include text, variables, and expressions. For example:
Where:
While the app is in test mode (that is, it has not passed a deployment check), the webhook can be invoked. This allows you to test your webhook before your application is deployed. Note: This setting is available only when Preset is set to Custom or Slack Hook.
|
HTTP Verb |
HTTP verb used to call the web service. Select a value from the list. Valid values include Delete, Get Patch, Post (most common), and Put. Note: This setting is available only when Preset is set to Custom.
|
HTTP Content Type |
Content type of the body. Valid content type values include:
Defaults to JSON. Note: This setting is available only when Preset is set to Custom.
|
App Id |
ID of app to send the request to. Defaults to the ID of the current app. Note: This setting is available only when Preset is set to AppSheet API.
|
Target Table Name |
Name of the target table in the app to send the request to. See Tables: The Essentials for more information about adding tables. Note: This setting is available only when Preset is set to AppSheet API.
|
Body |
Body containing the command or data to send to the webhook. To define the body, do one of the following:
Note:
Defaults to data values from the added or updated row, excluding |
HTTP Headers |
List of HTTP headers that are included in the HTTP request. It is common to include an Click Add to add an HTTP header using the following format:
The header name and header value may include constants or AppSheet expressions. The expression result will replace the expression in the HTTP header. If the header value contains quote characters, you must enclose the entire header value within quotes, and escape each embedded quote with two quotes. For example, if the header name is By default, AppSheet sets the Example: When invoking Pushpad from a webhook, you might need to include the following header values:
Note: This setting is only available when Preset is set to Custom or AppSheet API.
|
Body Template |
Template to use for more precise control of the webhook body. See Use templates in a bot and the Body setting description (above). Note: This setting is only available when Preset is set to Custom or AppSheet API.
|
Body Template Data Source |
Data source used for the body template. Note: This setting is only available when Preset is set to Custom or AppSheet API.
|
Return value |
Enable this toggle to capture the return values from web service call. See Use return values from webhooks. |
Specific types |
Enable this toggle to capture the return values from web service call. See Use return values from webhooks. |
Timeout |
Number of seconds AppSheet should wait for the webhook to complete before timing out. Defaults to 180. |
Max number of retries on failure |
Maximum number of times to retry the webhook in the event of failure. Defaults to 3. |
Run asynchronously |
Toggle that specifies whether AppSheet runs asynchronously as a background task. Invoking the webhook asynchronously can improve client response time. Before setting this setting, consider whether your application requires the webhook to complete synchronously to execute correctly. For example, if your webhook is changing data and your application relies on that data being updated before the sync completes, then using an asynchronous call may yield incorrect results. By default, the setting is disabled. Note: This setting is available only when Return value is turned off.
|
Expand and customize the Advanced settings, as described below.
Setting |
Description |
Inputs |
Add inputs to dynamically configure a task. For details, see Set input values dynamically in tasks.
Then, use the following expressions to access the input values from the current step: |
Specify the HTTP Basic Authentication header
You can specify an HTTP Basic Authentication header as follows.
- Header name:
Authorization
- Header value:
Basic <base64-encoded authentication value>
When invoking Twilio, you must specify your Twilio Account SID, followed by a colon, followed by your Twilio Auth Token in the form:
<TwilioAccountSID>:<TwilioAuthToken>
Example:
If your Twilio Account SID is BDe8de733fd2363d6d0d86719f6ad324db
and your Twilio Auth Token is 5c3a028974b570eebc48fc4de2a5f567
, the resulting authentication value is:
BDe8de733fd2363d6d0d86719f6ad324db:5c3a028974b570eebc48fc4de2a5f567
When this value is Base64 UTF-8 encoded using a web service like Base64Encode.org it yields the value:
QkRlOGRlNzMzZmQyMzYzZDZkMGQ4NjcxOWY2YWQzMjRkYjo1YzNhMDI4OTc0YjU3MGVlYmM0OGZjNGRlMmE1ZjU2Nw==
The resulting header value is:
Basic QkRlOGRlNzMzZmQyMzYzZDZkMGQ4NjcxOWY2YWQzMjRkYjo1YzNhMDI4OTc0YjU3MGVlYm
M0OGZjNGRlMmE1ZjU2Nw==