How to integrate Peasy with third party software using webhooks #
Webhooks are HTTP callbacks that are triggered when events such as contact creation happens in Peasy. You can use webhooks to integrate with Peasy with third party applications.
Example of possible integrations:
- Create a new contact in your CRM whenever you receive WhatsApp message from a new contact
- Update contact attributes in your CRM whenever your sales team or chatbot update an contact on Peasy
- Create a new customer in your POS or Accounting software when ever a contact status has been changed to Won
The possibilities are limitless. You’ll need to implement some form of coding to use webhooks.
How to create and update webhooks #
Step 1 Click on the Integrations link in the settings sidebar. Next, click on “Configure” button.
Step 2. Click on the “Add new webhook” button to create a new webhook. Or click on an existing webhook to edit the webhook’s configuration.
Step 3. A dialog popup will appear when you click on the “Add new webhook” button. Type in the URL to which the POST request should be sent. Select the events you want to subscribe. This option would allow you to only listen to the relevant events in Peasy.
Webhook Payloads #
Peasy will send a POST request with payload to the configured URLs when ever your subscribed events are triggered.
You must ensure that:
- You have a fully functional application capable of receiving and processing the payload. Peasy transmit the payload in JSON form.
- Your web server’s security allow incoming POST call from Peasy
Sample Payload #
{
"event": "contact_created", // The name of the event
"id": "1",
"name": "Ben",
"avatar": "https://gravatar.com/1010",
"type": "contact",
"phone_number": "+60120000000",
"custom_attributes": [ "location": "KL", "position": "Sales Manager"],
"email": "ben@peasy.ai",
"account": {
"id" :0,
"name": "Peasy"
}
}