Xsender API is a robust and versatile communication platform designed to streamline message dispatching across multiple channels, including Email, SMS, and WhatsApp. This API empowers developers and businesses to seamlessly integrate messaging capabilities into their applications and systems with high reliability and efficiency.
Note: The WhatsApp API currently supports sending messages only via a connected node device. However, we plan to integrate the WhatsApp Cloud API in a future update to enhance functionality and scalability
Firstly you generate API key

To interact with the API, ensure that you include the API key in the request headers. Use the following guidelines:
Header Requirement:
Key: Api-key
Value: Your unique API key (provided upon registration).
To send email use the url : https://xsender.igensolutionsltd.com/api/email/send

To send email from API format data like below :
$postdata = array(
"contact" => array(
array(
"subject" => "This is a API test",
"email" => "[email protected]",
"message" => "This is a API \ntest",
"gateway_identifier" => "*****************"
),
)
);To schedule a mail through API format you data like below :
$postdata = array(
array(
"subject" => "This is a API test",
"email" => "[email protected]",
"message" => "This is a API \ntest",
"schedule_at" => "2024-07-10 12:25:00"
)
);If you wish to Add a sender name in you mail sending through API format you data like below
$postdata = array(
array(
"subject" => "This is a API test",
"email" => "[email protected]",
"message" => "This is a API \ntest",
"sender_name" => "Postman",
"schedule_at" => "2024-07-10 12:25:00"
)
);To send bulk messages through API format the postdata like below
$postdata = array(
"contact" => array(
array(
"subject" => "This is a API test",
"email" => "[email protected]",
"message" => "This is a API \ntest",
"schedule_at" => "2024-07-10 12:25:00"
),
array(
"subject" => "This is a API test",
"email" => "[email protected]",
"message" => "This is a API \ntest",
"schedule_at" => "2024-07-10 12:25:00"
),
array(
"subject" => "This is a API test",
"email" => "[email protected]",
"message" => "This is a API \ntest",
"schedule_at" => "2024-07-10 12:25:00"
)
)
);
Send using cURL
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://xsender.igensolutionsltd.com/api/email/send',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($postdata),
CURLOPT_HTTPHEADER => array(
'Api-key: ###########################',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
// Optionally, handle the response here
echo $response;Replace '###########################' with your actual API key and make sure $postdata contains the correct data for the email
Response data :
{
"success": true,
"message": "New Email Request Sent, Please Check The Email History For Final Status",
"data": [
{
"uid": "c8d1b339-1887-45bb-aee4-8cdc3e98",
"email": "[email protected]",
"status": "Pending",
"created_at": "2024-07-10 12:23 PM"
},
{
"uid": "f7434449-0671-42cf-ae53-3a4057ec",
"email": "[email protected]",
"status": "Schedule",
"created_at": "2024-07-10 12:23 PM"
}
]
}To send sms use the url : https://xsender.igensolutionsltd.com/api/sms/send

To SMS from API format data like below :
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"body" => "This is a test from \nxsender",
"sms_type" => "plain",
"gateway_identifier" => "*****************"
)
)
);Check the dropdown description for complete code sample

To schedule a SMS through API format you data like below :
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"body" => "This is a test from \nxsender",
"sms_type" => "plain",
"schedule_at" => "2024-07-10 14:39:00"
)
)
);To send bulk SMS through API format the postdata like below:
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"body" => "This is a test from \nxsender",
"sms_type" => "plain",
"gateway_identifier" => "*****************"
),
array(
"number" => 123456789,
"body" => "This is a test from \nxsender",
"sms_type" => "plain",
"gateway_identifier" => "*****************"
),
array(
"number" => 123456789,
"body" => "This is a test from \nxsender",
"sms_type" => "plain",
"gateway_identifier" => "*****************"
)
)
);Send using cURL
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://xsender.igensolutionsltd.com/api/email/send',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($postdata),
CURLOPT_HTTPHEADER => array(
'Api-key: ###########################',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
// Optionally, handle the response here
echo $response;Replace '###########################' with your actual API key and make sure $postdata contains the correct data for the email
Response data :
//response will return data in this format
{
"success": true,
"message": "New SMS Request Sent, Please Check The SMS History For Final Status",
"data": [
{
"uid": "aa1bd670-861f-4607-9695-2710cffa",
"number": 123456789,
"status": "Pending",
"created_at": "2024-07-10 02:49 PM"
},
{
"uid": "fc384475-7b6d-4106-98e2-569a51d4",
"number": 123456789,
"status": "Schedule",
"created_at": "2024-07-10 02:49 PM"
}
]
}To send WhatsApp Message use the url : https://xsender.igensolutionsltd.com/api/whatsapp/send
To send WhatsApp messages from API format data like below :
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"message" => "some *text*",
"session_name": "**********"
)
)
);Check the dropdown description for complete code sample

To schedule a WhatsApp through API format you data like below :
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"message" => "some *text*",
"schedule_at" => "2024-07-10 15:30:00",
"session_name": "**********"
)
)
);To send Media /url using WhatsApp through API format you data like below :
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"message" => "some *text*",
"media" => "image",
"url" => "https://some-site-example.jpg",
)
)
);To send bulk messages through WhatsApp using Xsender API format the postdata like below:
$postdata = array(
"contact" => array(
array(
"number" => 123456789,
"message" => "some *text*",
"schedule_at" => "2024-07-10 15:30:00",
"session_name": "**********"
),
array(
"number" => 123456789,
"message" => "some *text*",
"schedule_at" => "2024-07-10 15:30:00",
"session_name": "**********"
),
array(
"number" => 123456789,
"message" => "some *text*",
"schedule_at" => "2024-07-10 15:30:00",
"session_name": "**********"
)
)
);Send using cURL
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://xsender.igensolutionsltd.com/api/email/send',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($postdata),
CURLOPT_HTTPHEADER => array(
'Api-key: ###########################',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
// Optionally, handle the response here
echo $response;Replace '###########################' with your actual API key and make sure $postdata contains the correct data for the email
Response data :
{
"success": true,
"message": "New WhatsApp Request Sent, Please Check The WhatsApp History For Final Status",
"data": [
{
"uid": "1ea910b9-bafb-41b1-82a5-bb8c750e",
"to": 123456789,
"status": "Schedule",
"created_at": "2024-07-10 03:29 PM"
},
{
"uid": "888e8f18-8933-41fc-baae-439da345",
"to": 123456789,
"status": "Pending",
"created_at": "2024-07-10 03:29 PM"
},
{
"uid": "ba8fe315-1e61-4ca7-a8a2-dd9485ab",
"to": 123456789,
"status": "Pending",
"created_at": "2024-07-10 03:29 PM"
}
]
}