Wednesday, 13 April 2022 10:51

Octapush Webhooks – Update of external CRM/ERP systems with POST or GET method


Webhooks are user-defined HTTP callbacks that can be used to inform/update external CRM/ERP systems when an event occurs such as the status change of a message.

You can find them in the Developers link that is located in the user menu at the top right corner of the platform.

The panel to configure your webhooks is placed at the bottom of your screen.

In case you cannot see the Webhooks panel as it is shown in the below image, please contact our support department to activate the webhooks in your account.



Octapush will send an HTTP callback each time a specific event takes place for which you’ve set to receive updates. You can select between POST or GET method and furthermore during the call you may include all the information that Octapush has on the specific recipient. This is possible thanks to the available tokens that you can include in your link.



Messages Statuses

When a message is sent through Octapush, it can take different statuses that inform us whether it was delivered on not and the reasons why. If the status is final, then we’ll not receive any further updates about the corresponding message, otherwise, the message hasn’t reached its final state and there will follow more updates.

The following table includes all the available statuses that an SMS or Viber message can take along with a brief explanation for each one.

Status

VIBER

SMS

Explanation

Final

Sent

The message has been sent to the final network to be delivered

NO

Pending

The state of the message is not yet known

NO

Submitted

The message has been routed for sending

NO

Scheduled

The message has been scheduled for sending in a future time

NO

Fallbacksms

The message wasn’t delivered via Viber and it has been forwarded for sending via SMS

NO

Not Delivered

The message was not delivered

YES

Unknown

The message took another status from the ones we have available

YES

Error

Error during the sending process

YES

Expired

The message wasn’t delivered within the time frame we’ve set

YES

Failed

Sending failed due to insufficient balance in your account

YES

Rejected

A message is rejected when the system rejects it’s sending due to routing reasons. Wrong number or not supported termination to a specific network are common reasons.

YES

Canceled

The sending of the message has been canceled

YES

Seen

The recipient has seen the message.

YES

Clicked

The recipient has clicked a link in the message

YES

Blacklisted

The recipient’s number is blacklisted

YES

Unsubscribed

The recipient clicked on the unsubscribed option

YES

Blocked

The Viber Sender Id that sent the message has been blocked

YES


Tokens

The main tokens that our platform provides are: Phone Number, First Name, Last Name, Title, Option 1, Option 2.

In case you’ve created extra fields in your list, for example a custom ID, then this will be shown as token and you can use it with the webhooks that you’ll create.


Create Webhooks

To create a new webhook you have to select the channel you want this webhook to be used. The choices are two: SMS or Viber.


Then, you click on the Edit button at the bottom of the page and you are ready to activate the webhooks for any of the provided statuses, as you can see below.

In case we want to receive an update in an external system for an event that occurs in Octapush, we have to activate the switch on the left side of this event, set the URL that will receive the callback and set the variables we want to be included.

If we want to use the GET method for the blacklisted status, then we’ll have to fill in the form as shown below.


If we want to use the POST method for the submitted status, we’ll have to use the JSON format as shown below.


More information about the JSON format you can find in the following link: https://www.w3schools.com/whatis/whatis_json.asp