API
API Docs
Welcome to the Sendra API documentation. Our API collection provides a robust set of endpoints that allow seamless integration of your applications with Sendra's advanced WhatsApp marketing automation services. With this API, you can programmatically manage your messaging campaigns, customer interactions, and access a wealth of analytics to refine your strategies.
Whether you're looking to automate communication flows, synchronize your CRM data with Sendra, or tap into the vast capabilities of WhatsApp messaging, our API makes these tasks straightforward and efficient. Enjoy features such as sending messages, managing templates, retrieving message statistics, and much more.
Utilize this documentation to get detailed information on each endpoint, including request and response structures, HTTP methods, and sample code to help you get started. Happy coding, and we look forward to powering up your application with Sendra!
GETGetContacts
https://app.sendra.app/api/wpbox/getContacts?token=your_token
Get Contacts
This endpoint retrieves the list of contacts.
Request
Endpoint
GET
https://app.sendra.app/api/wpbox/getContacts
Query Parameters
token
(string, required): The authentication token.
Response
status
(string): The status of the response.contacts
(array): An array of contact objects with the following properties:id
(integer): The unique identifier of the contact.name
(string): The name of the contact.phone
(string): The phone number of the contact.avatar
(string): The avatar URL of the contact.country_id
(integer): The ID of the country associated with the contact.company_id
(integer): The ID of the company associated with the contact.deleted_at
(string): The date and time when the contact was deleted, if applicable.created_at
(string): The date and time when the contact was created.updated_at
(string): The date and time when the contact was last updated.last_reply_at
(string): The date and time of the last reply from the contact.last_client_reply_at
(string): The date and time of the last reply from the client.last_support_reply_at
(string): The date and time of the last reply from the support team.last_message
(string): The last message sent by the contact.is_last_message_by_contact
(integer): Indicates if the last message was sent by the contact (1) or not (0).has_chat
(integer): Indicates if the contact has an active chat (1) or not (0).resolved_chat
(integer): Indicates if the chat with the contact is resolved (1) or not (0).user_id
(integer): The ID of the user associated with the contact, if applicable.enabled_ai_bot
(integer): Indicates if the AI bot is enabled for the contact (1) or not (0).
Example:
View Morejson
{
"status": "",
"contacts": [
{
"id": 0,
"name": "",
"phone": "",
"avatar": "",
"country_id": 0,
"company_id": 0,
"deleted_at": null,
"created_at": "",
"updated_at": "",
"last_reply_at": "",
"last_client_reply_at": null,
"last_support_reply_at": "",
"last_message": "",
"is_last_message_by_contact": 0,
"has_chat": 0,
"resolved_chat": 0,
"user_id": null,
"enabled_ai_bot": 0
}
]
}
PARAMStoken
your_token
Example RequestGetContactsView Morecurl
curl --location 'https://app.sendra.app/api/wpbox/getContacts?token=your_token'
Example Response
Body
Headers (0)
No response bodyThis request doesn't return any response body
POSTMakeContact
https://app.sendra.app/api/wpbox/makeContact
Make Contact
This endpoint allows you to make contact with a user.
The request should be sent to
https://app.sendra.app/api/wpbox/makeContact
using the HTTP POST method.
Request Body
The request body should be in the raw format and include the following parameters:
token
(string): The token for authentication.phone
(string): The phone number of the contact.
Response
Status: 200 OK
status
(string): The status of the contact request.contact
(object): Details of the contact including id, name, phone, avatar, country_id, company_id, deleted_at, created_at, updated_at, last_reply_at, last_client_reply_at, last_support_reply_at, last_message, is_last_message_by_contact, has_chat, resolved_chat, user_id, and enabled_ai_bot.
Bodyraw (json)json
{
"token":"your_token",
"phone":"{{phone}}"
}
Example RequestSendMessage Examplecurl
curl --location 'https://app.sendra.app/api/wpbox/makeContact' \
--data '{
"token":"your_token",
"phone":"{{phone}}"
}'
200 OKExample Response
Body
Headers (10)
View Morejson
{
"status": "success",
"contact": {
"id": 1,
"name": "Your Name",
"phone": "+966********",
"avatar": "https://secure.gravatar.com/avatar/e2909c35cdbad84bf2b6059fe7eab2444cd6bd9fbf8af59918a1d0f4901c8ad2?s=128",
"country_id": 124,
"company_id": 1,
"deleted_at": null,
"created_at": "2023-12-25T08:42:08.000000Z",
"updated_at": "2023-12-25T08:42:08.000000Z",
"last_reply_at": "2023-12-25 09:42:08",
"last_client_reply_at": null,
"last_support_reply_at": "2023-12-25 09:42:08",
"last_message": "Sure, you can visit us from 09AM - 08PM",
"is_last_message_by_contact": 0,
"has_chat": 1,
"resolved_chat": 0,
"user_id": null,
"enabled_ai_bot": 1
}
}
POSTSendCampaing
https://app.sendra.app/api/wpbox/sendcampaignsBodyraw (json)View Morejson
{
"campaing_id":3,
"token":"your_token",
"phone":"{{phone}}",
"data":{
"order":{
"id":1232,
"status":"delivered",
"price":"45$"
},
"user":{
"name":"Melanija Dimov",
Last updated