API Documentation for SendCallToZapier Listener and CallResource
Overview
This documentation details the SendCallToZapier event listener in a Laravel application, which is designed to send call data to configured Zapier webhook URLs when a CallCreated event is triggered.
Event: CallCreated
This event is triggered when a new call is created in the system, passing the call data to the SendCallToZapier listener.
Listener: SendCallToZapier
Description
Upon receiving the CallCreated event, the listener retrieves all Zapier webhook URLs based on the user's integration settings and sends the call data to these URLs.
Process Flow
User and Webhook URL Retrieval:
- Fetches user IDs based on the call's associated client or company.
- Retrieves Zapier webhook URLs for users with 'new_call' event integration.
- Input:
Callobject from theCallCreatedevent. - Output: Array of webhook URLs.
Data Formatting:
- Formats the call data using the
CallResource. - Input: Call data from the
CallCreatedevent. - Output: JSON formatted call data.
- Formats the call data using the
Data Transmission:
- Sends the formatted data to each retrieved webhook URL via HTTP POST request.
- Output: HTTP POST requests to each webhook URL.
- Payload: Formatted call data in JSON.
CallResource
Description
Transforms the call data into a structured JSON format suitable for consumption by the Zapier webhook.
Input
- Type: Call object from
CallCreatedevent. - Fields: Includes various attributes such as IDs, names, phone numbers, and caller details.
Output
- Type: JSON object.
- Content: Structured data including call details.
Fields
id: Unique identifier of the call.campaign_id: Associated campaign's identifier.campaign_name: Name of the associated campaign.company_id: Identifier of the linked company.company_name: Name of the linked company.client_id: Identifier of the client (nullable).client_name: Name of the client (nullable).campaign_phone_number: Phone number associated with the campaign.campaign_forward_to_phone_number: Forwarding number for the campaign.caller: Object containing the caller's details (name, city, state, zip, phone number).created_at: Timestamp of call creation.
JSON Structure
{
"id": "int",
"campaign_id": "int",
"campaign_name": "string",
"company_id": "int",
"company_name": "string",
"client_id": "int|null",
"client_name": "string|null",
"campaign_phone_number": "string",
"campaign_forward_to_phone_number": "string",
"caller": {
"name": "string",
"city": "string",
"state": "string",
"zip": "string",
"phone_number": "string"
},
"created_at": "datetime"
}
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article