Outbound Integration

Table of Contents

Outbound Integration:
Whatsapp > CRM and your other systems

Share this article with your developer or use Zapier to integrate your system with Whatsapp

“New message” Event

It is possible to notify external system when a new message (text or attachment, including voice message) is received or sent in any connected whatsapp account in a workspace. This also includes whatsapp messages sent from within Timelines.

In order to do so, a workspace owner should navigate to “Integration / Outbound” screen and enter URL provided by an external system, to which Timelines will post a JSON message, including all details of the message, in the format as described below.

Available actions

  • “Webhook enabled” – allows to disable the webhook without removing it entirely
  • “Event” – right now there’s only one selection: “New message” – new chat or new message gets sent into system
  • “Webhook URL” – can be left empty to clear the webhook
  • “Save” – will save and enable the webhook (or disable it, if left empty)
  • “Save and test” – will save the webhook and notify it with the last message (any most recent message in the Workspace).
  • “Last sending attempts” – summary of last attempts to notify the webhook (reload the page to refresh the list)
  • “Download log” – a details log of 100 last attempts, in json format, with request payload and external system’s response.

Message format

The following JSON body will be sent to a webhook by means of POST.

The external system should be configured to process the message

{
 "message": {
   "whatsapp account" :
   {
     "full name" : "John Doe",
     "email" : "john.doe@acme.com",
     "phone" : "+972540000000"
   },
"contact": {
"full name": "Jane Smith"
"is_group": false
"phone": "+972550000000"
},
   "direction": "sent", 
   "timestamp": "2021-02-24T06:25:29+0000",
   "message_id": "ddfskhsd76dsfs6dsd5skjsdhf",
   "sender": {
     "full name": "John Doe",
     "phone": "+972540000000"
   },
   "receiver": {
     "full name": "Jane Smith",
     "phone": "+972550000000"
   },
   "text": "lorem ipsum",
   "attachment": { 
     "filename": "Python-3.9.0.tgz",
     "download_url": "https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz"
   }
 }
}

Sending errors

After more than 10 attempts to notify the webhook, that resulted in error (invalid URL or server response other than 20x), workspace user will be sent an email notification and the webhook will be automatically disabled. In such case, it is advisable to examine the log file to determine the problem.

In any case, Timelines will not try to resend message in case of error response by the webhook.

Latest posts by admin (see all)