Only Custom plan users can integrate with Webhook. If you are interested in Webhook Integration, please contact the Cooby Sales Team.
In this guide, you'll connect WhatsApp to your destination using Cooby custom Webhooks.
You can use the same Webhook for the 2 different event triggers, or set up separate Webhooks for each event trigger.
Set up guide
This guide uses webhook.site as an example
Go to your workspace integration center
Find
Custom Webhook
and click onIntegration Guide
.Create a Webhook endpoint in your desired destination.
Paste the Webhook URL into the Trigger actions when receiving WhatsApp messages field in the Cooby integration guide, then click
Save
.Ensure that you see the Webhook URL saved, indicating a successful save.
Go back to the previous page and click on
Manage Permissions
for theCustom Webhook
field.Turn ON the Custom Webhook permission for those who will trigger Webhook events when they receive WhatsApp messages.
To ensure that the Webhook integration is set up properly, remember to refresh both your WhatsApp Web and the WhatsApp Web of your team members after making any changes to the settings.
Once you have received the payload, you can use it to set up various actions.
Payload Format
{
chat_id: string;
chat_type: "group" | "individual";
chat_title: string;
user_phone: string;
user_email: string;
direction: "sent" | "received";
message: {
id: string;
type: "call_log" | "chat" | "location" | "payment" | "vcard" | "ciphertext" | "multi_vcard" | "revoked" | "oversized" | "groups_v4_invite" | "template_button_reply" | "debug" | "image" | "video" | "audio" | "sticker" | "status_v3" | "document" | "product" | "order" | "list" | "interactive" | "interactive_response" | "list_response" | "buttons_response" | "reaction" | "reaction_enc" | "poll_creation" | "request_phone_number" | "poll_update" | "native_flow" | "biz-cover-photo" | "keep_in_chat" | "pin_message" | "unknown";
text: string;
file_name: string | null;
file_url: string| null;
caption: string | null;
is_error: boolean;
error_code: string | null;
error_message: string | null;
};
timestamp: string;
participants: {
phone: string;
wa_name: string;
}[];
sender: {
phone: string;
wa_name: string;
};
}
Example payload
{
chat_id: "[email protected]";
chat_type: "individual";
chat_title: "Sarah Brown";
user_phone: "447441368384";
user_email: "[email protected]";
direction: "sent";
message: {
id: "3EB093D273669B3BE3D2";
type: "chat";
text: "Hi, welcome to Cooby!";
file_name: "Cooby Image 2023-07-12 at 11.13.32 AM";
file_url: "https://api.cooby.co/v2/files/xxxxx";
caption: "Hi, welcome to Cooby!";
is_error: false;
error_code: null;
error_message: null;
};
timestamp: "1628843453";
participants: [
{
phone: "447441369136";
wa_name: "Sarah Brown";
},
{
phone: "447441368384",
wa_name: "Cooby"
}
],
sender: {
phone: "447441368384";
wa_name: "Cooby";
};
}
We hope this document helps you better understand how Cooby works. For any concerns or questions regarding your Custom Webhook integration, kindly email us at [email protected] 💜