Webhook

In this documentation, we will explain how to use webhook in OneTalk.

Head to "Integration" and click "Webhooks" and you can start setup a webhook by clicking "Set" on the top right corner.

Enable the webhook and input "Webhook URL" field

Next, you will have to choose a minimum of 1 event on "Subscribed Events" and click "Save Changes" to finalize your webhook.

Webhook Events

Integration Message Status

this webhook event updates your system about the change in status of messages sent via Integration API.

Request payload example:

FieldTypeDescription

type

string

Type of webhook event

integrationMessageStatus

object

Contains data of webhook event

channelID

string

Channel ID

channelType

string

Channel type

contactPhone

string

Recipient's phone number

reason

string

Failed reason

status

string

Status update on the message

timestamp

timestamp

Timestamp on the status update

trxID

string

Transaction ID

organizationID

int

Organization ID

{
  "type": "integration_message_status",
  "integrationMessageStatus": { 
    "channelID": "0123456",
    "channelType": "whatsapp|whatsappba",
    "contactPhone": "628123456789",
    "reason": "...",
    "status": "acknowledge|delivered|read|failed",
    "timestamp": 1587352926788,
    "trxID": "000000-0000-0000-0000-000000"
  },
  "organizationID": 1111
}

Status 'acknowledge' is updated when WhatsApp has received OneTalk's request to send the message.

Status 'delivered' is updated when WhatsApp recipient has received the message.

Status 'read' is upated when WhatsApp recipient has read the message.

Status 'failed' is updated when there's an error either from TapTalk.io's system or WhatsApp's system.

Case Resolved

this webhook event updates your system about the changed in case status to "Resolved" in your organization.

Request payload example:

FieldTypeDescription

organizationID

int

Organization ID

type

string

Type of webhook event

caseResolved

object

Contains data of webhook event

caseID

string

Case ID

channelType

string

Channel type

channelID

string

Channel ID

topicID

string

Topic ID

topicName

string

Topic Name

assigneeType

string

Type of case last assigned to

chatbotID

string

Chatbot ID if assigned to bot

chatbotName

string

Chatbot name id assigned to bot

agentEmail

string

Agent's email if assigned to agent

agentFullName

string

Agent's name if assigned to agent

isJunk

boolean

Junk status

agentRemark

string

Agent's remark on the case

createdTime

timestamp

Created time

counterStartTime

timestamp

The time to start counting duration from, in Unix milliseconds.

firstResponseTime

timestamp

First response time by agent

resolvedTime

timestamp

Case resolved time

isResolvedByAgent

boolean

If case resolved by an agent

isResolvedByChatbot

boolean

If case resolved by a bot

isResolvedByContact

boolean

If case resolved by contact

isResolvedBySystem

boolean

If case resolved by system

labels

array

Array of labels tagged on the case

contact

object

Contains data of contact

id

string

Contact ID

fullName

string

Contact's full name

alias

string

Contact's alias

email

string

Contact's email

phone

string

Contact's phone number

customerUserID

string

the userID from customer's server

companyName

string

Contact's company name

jobTitle

string

Contact's job title

agentRemark

string

Agent's remark on the contact

customField

object

Contains objects of custom field if there's one or more custom field in the organization

*Field Code*

object

Custom field's field code

fieldType

string

Custom field's type

value

string

Custom field's value

{
    "organizationID": 1,
    "type": "case_resolved",
    "caseResolved": {
      "caseID": "958CCF3BB6",
      "channelType": "whatsapp",
      "channelID": "166090",
      "topicID": 1,
      "topicName": "Finance",
      "assigneeType": "agent",
      "chatbotID": "",
      "chatbotName": "",
      "agentEmail": "john@example.com",
      "agentFullName": "John",
      "isJunk": false,
      "agentRemark": "Hello world 3",
      "createdTime": 1589354307263,
      "counterStartTime": 1589354307263,
      "firstResponseTime": 1589355184000,
      "resolvedTime": 1615305000400,
      "isResolvedByAgent": true,
      "isResolvedByChatbot": false,
      "isResolvedByContact": false,
      "isResolvedBySystem": false,
      "labels": [
        "follow up",
        "hello world"
      ],
      "contact": {
        "id": "e148aa04-3e8f-4dd9-82c1-e53c1a93eac1",
        "fullName": "John Doe",
        "alias": "John",
        "email": "",
        "phone": "6281234567890",
        "customerUserID": "johndoe",
        "companyName": "",
        "jobTitle": "",
        "agentRemark": "",
        "customFields": {
          "customer_id": {
            "fieldType": "single_line",
            "value": ""
          },
          "deal_amount": {
            "fieldType": "number",
            "value": ""
          },
          "salutation": {
            "fieldType": "dropdown",
            "value": ""
          }
        }
      }
    }
  }

Last updated