Manage Outgoing WebHooks for Conversations

Manage Outgoing WebHooks for Conversations

Written by Julien Jovet
Last update: Tuesday, Dec 31, 2024

Introduction:

Polaria outgoing webhooks allow your system to receive notifications in real time when specific events occur, such as the creation or resolution of conversations. These webhooks send structured JSON data via HTTP POST requests to a predefined endpoint.

Webhook Event Types:

Test Event

A simple event to test webhook connectivity.

json

Copier le code

{ "event": "test", "token": "a-unique-token" }

Created Event (New Conversation)

Triggered when a new conversation is initiated.

json

Copier le code

{ "event": "new_conversation", "token": "a-unique-token", "payload": { "id": 12345, "started_at": "2018-12-06T15:20:11.000Z", "trigger": { "conversation_started_by_trigger": false, "trigger_id": null }, "user_group": { "conversation_in_a_user_group": true, "user_group_id": 123 }, "contact": { "name": "Remi Delhaye", "email": "[email protected]", "language": "en-US", "last_visited_page": "https://get.polaria.ai", "platform": "OS X (10.11.6)", "browser": "Chrome (52.0.2743.116)", "city": "San Francisco, CA", "country": "US", "referrer": "https://google.com", "pages_visited_count": 42, "custom_informations": { "user_id": 1234567, "firstname": "Rémi", "lastname": "Delhaye", "team_id": 1 } } } }

Key Fields:

  • id: Unique ID of the conversation.

  • started_at: Timestamp of when the conversation started.

  • contact: Information about the user initiating the conversation, including:

    • name, email, last_visited_page, browser, and custom_informations.

Ended Event (End Conversation)

Triggered when a conversation is resolved or closed.

json

Copier le code

{ "event": "end_conversation", "token": "a-unique-token", "payload": { "id": 12345, "started_at": "2018-12-06T15:20:11.000Z", "ended_at": "2018-12-06T15:21:11.000Z", "trigger": { "conversation_started_by_trigger": false, "trigger_id": null }, "user_group": { "conversation_in_a_user_group": true, "user_group_id": 123 }, "contact": { "token": "5aeae6e6-6a76-46bf-b0fa-eea1ab8289f6", "name": "Remi Delhaye", "email": "[email protected]", "language": "en-US", "last_visited_page": "https://get.polaria.ai", "platform": "OS X (10.11.6)", "browser": "Chrome (52.0.2743.116)", "city": "San Francisco, CA", "country": "US", "referrer": "https://google.com", "pages_visited_count": 42, "custom_informations": { "user_id": 1234567, "firstname": "Rémi", "lastname": "Delhaye", "team_id": 1 } }, "messages": { "count": 42, "url": "https://slaask.com/api/messages?token=5aeae6e6-6a76-46bf-b0fa-eea1ab8289f6&id=12345" }, "conversation_recap": "Wanted some help to create new webhooks.", "status": "resolved" } }

Key Fields:

  • ended_at: Timestamp of when the conversation ended.

  • status: Final status of the conversation (e.g., resolved).

  • messages: Information about exchanged messages, including count and a URL for details.

  • conversation_recap: A summary of the conversation.

Shared Fields:

  • event: Type of event (test, new_conversation, or end_conversation).

  • token: Unique token authenticating the request.

  • payload: Data specific to the event, including conversation and contact details.

Outgoing WebHooks IA

0 articles in this category.
Written by Julien Jovet.