Webhooks
A webhook is a way for an app to provide other applications with data in real time. Unlike typical APIs where you must send a request to an endpoint (such as a list of phone numbers) before receiving a response (“Group created” or “Error uploading list” or “List of responses”), webhooks push data as it happens.
To use a webhook, you register a URL with our system. That URL is an HTTP endpoint within your application that will accept the data and do something with it. Every time the webhook is triggered by an action in our system (such as a poll completion), our system will send a data package with the event type (such as “poll.complete”) and additional relevant information about the action to that registered URL.
This can be used to sync the latest responses to your database or trigger another action, such as a delivering an email report or kicking off the next step in your workflow after each response.
Configuring your webhooks
To configure a webhook, go to Edit Campaign, and enter the URL for your endpoint under "Activity Webhook".
Webhook Types
Currently, there is 1 webhook type available:
Event name | Description | Data included | Code snippets |
poll.completed |
This event fires whenever a poll is completed. |
|
Note: The poll.completed webhook only fires when a poll is fully completed. If the poll contains optional questions or informational messages, you may want to utilize the “Skip this question if” setting.
Alternatives to webhooks
If your goal is to pull responses into an external database, another option is to write a script that fetches the poll results in CSV format at regular intervals. To get a poll’s results in CSV format, simply append “.csv” to the end of the poll URL.
Example: https://textizen.com/polls/3767 becomes https://textizen.com/polls/3767.csv
Download a sample result set using this technique.