Workflow

Webhook Integration

Webhooks are events that trigger an action. In most cases, they are used for communication between systems. This is the simplest way of getting an alert when something happens in another system.


How to add

You can create a webhook by clicking create new webhook under platform webhooks.

You will need 2 things here.

The content you want to use the webhook first.

The second is the endpoint of the webhook.

https://yourapp.com/webhook-endpoint
false

Webhook Settings

Delay

Delay in seconds between event trigger (set finish) and webhook fire in seconds. This will be usefull if you have leads on the result page and you want to give your visitors some time to get the lead data with your webhook.

Send Answers

Send all the votes with the data.

Send Leads

Send all user input leads with the data.

Send Incomplete

Triggers webhook even if user did not see the end result.

Incomplete Delay

Delay in seconds between set start and webhook fire. For example if you set this field as 120, Poltio will send votes up till 120 seconds after your visitor starts the set. If that visitor will complete the set after 120 seconds, you will also recieve another webhook event for that.

Example

Poltio will send a POST request with a JSON body to your URL with the following format.

To: yourapp.com/webhook-endpoint
Method: POST
Message:
{
    "poltio_user_id": 1234,
    "session_id": "Poltio Session ID",
    "publisher_uuid": "Publisher UUID",
    "event_time": 1568624875,
    "content_type": "Content type",
    "content_id": 12345,
    "complete_session": true,
    "answers": [
        {
            "question_id": 1234,
            "question": "Question Title",
            "answers": [
                {
                    "answer_id": 1234,
                    "answer": "Voted answer title"
                }
            ]
        }
    ],
    "result": {
        "result_id": 1234,
        "time_spent": null,
        "right_answer": null,
        "calculator_result": null,
        "result_title": null
    },
    "leads": [
        {
            "user_id": 1234,
            "phone": "+1231231234",
            "email": "example@example.com",
            "name": "Name",
            "comment": "Comment",
            "created_at": "DD/MM/YYYY",
            "tc_checked": true,
            "content_type": "Content type",
            "content_id": 12345
        }
    ]
}