#Information

Webhooks are the REST APIs you created yourself or offered by a third-party software, which get called when a message is received in a Sociocs channel.

URL of the REST API is referred to as webhook endpoint. You can set multiple webhooks endpoints for the same channel, or the same webhook endpoint for multiple channels.

#Channels supporting webhooks

  • SMS (with Twilio)
  • WhatsApp (with Gupshup)
  • WhatsApp (with Twilio)

#How to set it up?

In order for Sociocs to start calling your webhook endpoint on receiving incoming messages, you need to subscribe the endpoint for a specific channel. You can add multiple webhooks for the same channel, or same webhook for multiple channels, depending upon your needs.

#Webhook endpoint invocation details

Sociocs calls the webhook endpoints with an assumption that it's a REST API accepting JSON body parameters.

#Method used

POST

#Body parameters

NameValueData type
providertwlo (for Twilio SMS),
twlowa (for Twilio WhatsApp),
gswa (for Gupshup WhatsApp)
String
channel_keyChannel key associated to the webhookString
fromSending phone numberString
toReceiving phone numberString
nameSender's name (if available)String
textMessage textString
file_urlsPublicly accessible links to files in the messageArray of String
image_urlsPublicly accessible links to images in the messageArray of String
video_urlsPublicly accessible links to videos in the messageArray of String