Example: Listen to conversation lifecycle events

In this example, we'll listen to conversation lifecycle events and receive conversation data from Sinch Contact Pro by using a webhook.

For this integration, you'll need to configure the following:
  • Events: any
  • JSON for Configuration:

    To send all available conversation data from Sinch Contact Pro, refer to contact and event objects in the request body:

    {
      "request": {
        "authentication": {
          "type": "basic"
        },
        "method": "POST",
        "headers": {
          "x-api-key": "{authentications.api-key}"
        },
        "body": {
          "event": "{event}",
          "contact": "{contact}"
        }
      }
    }

    To define which contact data is sent from Sinch Contact Pro, specify each property you want to send in the body:

    {
      "request": {
        "method": "POST",
        "authentication": {
          "type": "basic"
        },
        "body": {
          "Event name": "{event.name}",
          "Event date": "{event.datetime}",
          "Channel type": "{contact.channel_type}",
          "Channel subtype": "{contact.channel_sub_type}",
          "Direction": "{contact.direction}",
          "ID": "{contact.id}",
          "Monitoring/reporting ID": "{contact.guid}",
          "Creation timestamp": "{contact.created}",
          "Language": "{contact.language}",
          "Priority": "{contact.priority}",
          "Skills": "{contact.skills}",
          "Current queue": "{contact.queue}",
          "Current queue ID": "{contact.queue.id}",
          "Current queue address": "{contact.queue.address}",
          "Forwarding queue": "{contact.forwarding_queue}",
          "Forwarding queue ID": "{contact.forwarding_queue.id}",
          "Forwarding queue address": "{contact.forwarding_queue.address}",
          "Current agent": "{contact.agent}",
          "Current agent ID": "{contact.agent.id}",
          "Current agent number": "{contact.agent.number}",
          "Current agent chat address": "{contact.agent.chat_address}",
          "Preferred agent": "{contact.preferred_agent}",
          "Preferred agent ID": "{contact.preferred_agent.id}",
          "Preferred agent number": "{contact.preferred_agent.number}",
          "Preferred agent chat address": "{contact.preferred_agent.chat_address}",
          "Required agents": "{contact.required_agents}",
          "Transferring agent": "{contact.transferring_agent}",
          "Transferring agent ID": "{contact.transferring_agent.id}",
          "Transferring agent number": "{contact.transferring_agent.number}",
          "Transferring agent chat address": "{contact.transferring_agent.chat_address}",
          "Source": "{contact.source}",
          "Destination": "{contact.destination}",
          "External Destination": "{contact.external_destination}",
          "CAD": "{contact.cad}"
        }
      }
    }