Working with Webhooks

Steps to start working with webhooks in the CommPeak SMS platform.

📘

What is a webhook?

A webhook is a way for an application to immediately deliver real-time data to other applications. It’s more efficient than APIs: APIs send requests and receive responses, while webhooks don’t require requests. They send data when it’s available.

You can set up webhooks in the CommPeak SMS platform and configure it to send data to an external system. For example, when you get an incoming message, the platform can forward the message data to any third party to perform analysis and take further action.

To access the TextPeak Webhooks tab options:

  1. Log in to TextPeak in your browser.
  2. In the main TextPeak menu, select the Webhooks tab.

To configure webhooks, expand Webhooks in the main menu and go to Management.

Screenshot of the 'Webhooks' tab with two children: 'Management' and 'Requests Log' as the fragment of the TextPeak side menu.

Webhooks tab

Here, you can view a table with your data on webhooks and apply search filters:

Screenshot of the Webhook Management tab

Webhook Management page

If you'd like to turn off a webhook temporarily, you can use the slider control at the beginning of the row.

Besides editing and deleting a specific webhook, the Actions column lets you test this webhook and display a request preview.

Click the three-dot icon to open the menu with the following webhook management options:

  • Test webhook
  • Request Preview
  • Edit Webhook
  • Delete.
Screenshot with the webhooks table and webhook management options

Webhook management options

Select Test webhook to send a request to the configured endpoint with the match trigger structure and dummy data.

Screenshot of the webhook test details

Webhook test details

To create a webhook:

  1. Click Add Webhook at the top-right of the page.

    📘

    NOTE

    If you haven't added any webhooks yet, click Add Webhook on the empty page.

  2. The Create new webhook form will load. Fill in the details and configure the new webhook.

    Screenshot of the form to create a new webhook highlights the 'Webhook Details' and 'Endpoint Configuration' input fields, the 'Create' and 'Cancel' buttons, and the 'Request Preview' window on the right.

    Create new webhook form

  • In Webhook Details, enter a name and select a trigger:

    • Webhook name: enter a meaningful title to locate the webhook quickly.

    • Trigger: choose from the drop-down list whether you want to trigger it by an incoming or delivery message, a Short URL click, or message EDR information (extended data about the message).

    • In Message status change (for delivery or EDR information message types only), select how you want to receive notifications:

      • Single: receive a status change notification for every message

      • Bulk: aggregate status change notifications in batch requests for every 100 messages to avoid the risk of being flagged as an attack by some servers.​

        Screenshot of the form to create a new webhook with the **Include message text** option enabled

        Create new webhook form with the Include message text option enabled

    • Include message text (for delivery message types): enable to include the message text in the delivery messages request.

    • Filter Stream (for incoming, delivery, or EDR information message types only): select a stream API or several streams for which you want to create webhooks.​

      Screenshot of the form to create a new webhook highlights the 'Webhook Details' and 'Endpoint Configuration' input fields, the 'Create' and 'Cancel' buttons, and the 'Request Preview' window on the right. In the 'Webhook details' section, the 'Filter Stream' field filled with data is highlighted.

      Create new webhook form highlighting the Filter Stream field filled with data

  • In Endpoint Configuration, enter the endpoint URL. Optionally, add HTTP headers.

    • URL: select the GET or POST method and enter the URL to which you want to send data
    • HTTP Headers: optionally, enter the key name and value.
  1. The requests' preview is available on the right. You can copy the request body immediately.
  2. Click Create Webhook.​