This guide provides practical examples of using the Call Requests API endpoints. Call requests allow customers to request a callback from your support team.
This endpoint retrieves a list of all call requests with their properties.
curl -X GET 'https://www.venddor.com.br/api/2.0/call_requests/'
status
or date_range
to filter the results.
This endpoint retrieves a specific call request by its ID.
curl -X GET 'https://www.venddor.com.br/api/2.0/call_requests/1'
This example command returns the call request with the request_id=1 and all its properties.
This endpoint creates a new call request in the system.
At least one of the following is required: email
or phone
Field | Description | Required |
---|---|---|
email |
Customer's email address | Required if phone not provided |
phone |
Customer's phone number | Required if email not provided |
name |
Customer's name | Optional |
time_from |
Preferred time to call (start) | Optional |
time_to |
Preferred time to call (end) | Optional |
user_id |
Associated user ID | Optional |
order_id |
Associated order ID | Optional |
product_id |
Associated product ID | Optional |
timestamp |
Time of the request | Optional |
status |
Current status of the call request | Optional |
notes |
Additional notes | Optional |
cart_products |
Products in customer's cart | Optional |
curl -H "Content-Type: application/json" -X POST https://www.venddor.com.br/api/2.0/call_requests -d '{"phone":"+7(999)111-22-33", "name":"John Doe", "time_from":"9:00", "time_to":"10:00"}'
This example creates a new call request from John Doe, who asks to be contacted between 9:00 and 10:00 at the specified phone number.
{request_id: 5}
This endpoint updates an existing call request in the system.
user_id
- Associated user IDorder_id
- Associated order IDproduct_id
- Associated product IDstatus
- Current status of the call requestnotes
- Additional notescurl -H "Content-Type: application/json" -X PUT https://www.venddor.com.br/api/2.0/call_requests/5 -d '{"status":"no_answer", "notes":"John didn't answer the call"}'
This example updates the status of the call request with request_id=5 to "No Answer" and adds a corresponding note.
{request_id: 5}
This endpoint deletes a specific call request from the system.
curl -X DELETE 'https://www.venddor.com.br/api/2.0/call_requests/5'
This example deletes the call request with request_id=5 from the system.
Status Code | Description |
---|---|
204 No Content |
The call request has been deleted successfully. |
400 Bad Request |
The call request couldn't be deleted. |
404 Not Found |
The specified call request doesn't exist. |