Call a webhook adding the Call a webhook task to a bot.

Configure the Call a webhook task by setting the properties described in the following table. When you are done, save the task by selecting one of the following:

  • Save - Save the task

  • Save & verify data - Save the task and verify the data defined.

  • Save & notify users - Save the task and notify users.

After you save the task, you can reuse it in other bots.

Note: If the web service you are connecting to restricts access by IP address, you will need to configure it to accept traffic from the IP addresses 104.40.67.206 and 138.91.195.239.

Property

Description

Default (if applicable)

Task name

Name of the task. It must be unique within your app.

Table name

Table referenced by the task. Select an existing table in the list.

Click View definition to view the structure of the selected table.

See Tables: The Essentials for more information about adding tables.

Preset

Customize all settings or select a preset to pre-populate a subset of values.

Valid values include:

  • Custom - Set all configuration values manually.

  • Slack Hook - Pre-populate values for a Slack webhook.

  • AppSheet: Action - Pre-populate values for an AppSheet action.

  • AppSheet: Add Row - Pre-populate values for an AppSheet add row data change action.

  • AppSheet: Delete Row - Pre-populate values for an AppSheet delete row data change action.

  • AppSheet: Edit Row - Pre-populate values for an AppSheet edit row data change action.

Custom

Url

URL of the web service for the HTTP request.

The URL must be absolute and may include text, variables, and expressions.

For example:

https://api.webservice.com/add/table/<<[Table Name]>>/id/<<[Record Id] + 1>>

If you are using the webhook to invoke the AppSheet API, enter the webhook URL value in the following form.

https://api.appsheet.com/api/v2/apps/{appId}/tables/{tableName}/Action

Where:

  • {appId} specifies the GUID of the AppSheet application. You can obtain the {appId} from the Manage > Integrations > IN pane.

  • {tableName} specifies the name of the table.

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 property is available only when Preset is set to Custom, Slack Hook, or AppSheet: Action.

HTTP Verb

HTTP verb used to call the web service.

Select a value from the list. Valid values include Delete, Patch, Post (most common), and Put.

Note: This property is available only when Preset is set to Custom or AppSheet: Action.

Post

HTTP Content Type

Content type of the body.

Valid content type values include:

  • CSV

  • FORM_URL_ENCODED

  • HTML

  • ICS_Calendar

  • JSON

  • PDF

  • XLSX (Microsoft Excel)

  • XML

Note: This property is available only when Preset is set to Custom or AppSheet: Action.

PDF

App Id

ID of app to send the request to.

Note: This property is available only when Preset is set to AppSheet: Add Row, AppSheet: Delete Row, or AppSheet: Edit Row.

ID of the current app

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 property is available only when Preset is set to AppSheet: Add Row, AppSheet: Delete Row, or AppSheet: Edit Row.

Body

Body containing the command or data to send to the webhook.

To define the body, do one of the following:

  • Enter the webhook body in this property, including text, images, variables, and expressions.

  • Leave this property blank and specify an Body Template (see below).

  • Leave this property and Body Template property blank to use the default content.

Note: The Body Template property (if specified) takes precedence over this property.

Data values from the added or updated row, excluding Hidden or Show type columns

HTTP Headers

List of HTTP headers that are included in the HTTP request.

It is common to include an Authentication header that contains authentication information such as authentication token or a username and password. See Specifying the HTTP Basic Authentication header.

Click Add to add an HTTP header using the following format:

<header>: <value> Repeat to add additional HTTP headers.

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 Authorization and the header value is Token token="537d7d", you should enter Authorization: "Token token=""537d7d""" in the header line.

By default, AppSheet sets the Content-Type header as follows: Content-Type: "application/json"

Example:

When invoking Pushpad from a webhook, you might need to include the following header values:

  • Authorization: "Token token=""9474e7dfeffa2eb49e656b4ba7c96a06"""

  • Accept: "application/json"

Note: This property is not available when Preset is set to Slack Hook.

Body Template

Template to use for more precise control of the webhook body. See Using templates and the Body property description (above).

Body Template Data Source

Data source used for the body template.

Script ID

ID of the script to be called.

Note: This property is available only when Preset is set to AppSheet: Action.

Function Name

Name of the function.

Note: This property is available only when Preset is set to AppSheet: Action.

Function parameters

Parameters to pass to the function.

Click Add to add a function parameter. Repeat to add additional function parameters.

Note: This property is available only when Preset is set to AppSheet: Action.

Timeout

Number of seconds AppSheet should wait for the webhook to complete before timing out.

180

Max number of retries on failure

Maximum number of times to retry the webhook in the event of failure.

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 property, 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.

Disabled

Specifying 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==


Did this answer your question?