{{ $title }}
{{ translate("API Key Generation and Documentations to use the functionality.") }}
{{ translate("Before you get started") }}
{{ translate("A brief overview of the API and its purpose") }}
{{ translatE("Endpoints: ") }}{{ translate("A list of all the endpoints available in the API, including their URLs and the HTTP methods they support.") }}
{{ translate("Request and Response: ") }} {{ translate("The expected request format and the format of the response, including examples of how to use the API and the data that it returns.") }}
{{ translate("Generate Api") }}
{{ translate("Please do not share the API Key") }}
{{ translate("Send Email") }}
{{ translate("This PHP method uses cURL to send email data to an API endpoint, receiving a") }} {{ translate("JSON response") }} {{ translate("with email request status and logs.") }}
$curl = curl_init();
$postdata = array(
"contact" = array(
array(
"subject" => "This is a API test",
"email" => "test@mail.com",
"message" => "This is a API \ntest",
"gateway_identifier" : "*****************"
),
array(
"subject" => "This is a API test",
"email" => "test@mail.com",
"message" => "This is a API \ntest",
"schedule_at" => "2024-07-10 12:25:00",
),
array(
"subject" => "This is a API test",
"email" => "test@mail.com",
"message" => "This is a API \ntest",
"sender_name" => "Postman",
"schedule_at" => "2024-07-10 12:25:00",
),
array(
"subject" => "This is a API test",
"email" => "test@mail.com",
"message" => "This is a API \ntest",
"reply_to_email" => "postman@api.com",
),
array(
"subject" => "This is a API test",
"email" => "test@mail.com",
"message" => "This is a API \ntest",
"sender_name" => "Postman",
"reply_to_email" => "postman@api.com",
),
);
);
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);
//response will return data in this format
{
"success": true,
"message": "New Email Request Sent, Please Check The Email History For Final Status",
"data": [
{
"uid": "c8d1b339-1887-45bb-aee4-8cdc3e98",
"email": "test@mail.com",
"status": "Pending",
"created_at": "2024-07-10 12:23 PM"
},
{
"uid": "f7434449-0671-42cf-ae53-3a4057ec",
"email": "test@mail.com",
"status": "Schedule",
"created_at": "2024-07-10 12:23 PM"
},
{
"uid": "5b6f9657-11dc-49e6-81c2-406c03e8",
"email": "test@mail.com",
"status": "Schedule",
"created_at": "2024-07-10 12:23 PM"
},
{
"uid": "dc3bc8a7-0515-45ce-8cae-c9498ac9",
"email": "test@mail.com",
"status": "Pending",
"created_at": "2024-07-10 12:23 PM"
},
{
"uid": "1cea2986-c7bf-4178-9b12-11aceef7",
"email": "test@mail.com",
"status": "Pending",
"created_at": "2024-07-10 12:23 PM"
}
]
}
{{ translate("This PHP method uses cURL to send email data to an API endpoint, receiving a") }} {{ translate("JSON response") }} {{ translate("with email request status and logs.") }}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{url('api/get/email/{uid}')}}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Api-key: ###########################,
),
));
$response = curl_exec($curl);
curl_close($curl);
//response will return data in this format
{
"success": true,
"message": "Successfully Fetched Email From Logs",
"data": {
"uid": "c8d1b339-1887-45bb-aee4-8cdc3e98",
"email": "test@mail.com",
"content": {
"subject": "This is a API test",
"message_body": "This is a API \ntest"
},
"status": "Success",
"updated_at": "2024-07-10 12:23 PM"
}
}
{{ translate("Send SMS") }}
"general"]) }}">{{ translate("Click here") }} {{ translate(" then navigate to the 'Other Setting' tab to update default sms method for API") }}
{{ translate("This PHP method uses cURL to send email data to an API endpoint, receiving a") }} {{ translate("JSON response") }} {{ translate("with email request status and logs.") }}
$curl = curl_init();
$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",
"schedule_at" => "2024-07-10 14:39:00",
),
)
);
curl_setopt_array($curl, array(
CURLOPT_URL => '{{route('incoming.sms.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);
//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"
}
]
}
{{ translate("This PHP method uses cURL to send email data to an API endpoint, receiving a") }} {{ translate("JSON response") }} {{ translate("with email request status and logs.") }}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{url('api/get/sms/{uid}')}}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Api-key: ###########################,
),
));
$response = curl_exec($curl);
curl_close($curl);
//response will return data in this format
{
"success": true,
"message": "Successfully Fetched SMS From Logs",
"data": {
"uid": "aa1bd670-861f-4607-9695-2710cffa",
"number": 123456789,
"content": {
"message_body": "This is a test from \nxsender"
},
"status": "Pending",
"updated_at": "2024-07-10 02:49 PM"
}
}
{{ translate("Send Whatsapp") }}
{{ translate("This PHP method uses cURL to send email data to an API endpoint, receiving a") }} {{ translate("JSON response") }} {{ translate("with email request status and logs.") }}
$curl = curl_init();
$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*",
"media" => "image",
"url" => "https://some-site-example.jpg",
),
array(
"number" => 123456789,
"message" => "some *text*",
"media" => "audio",
"url" => "https://some-site-example.mp3",
),
array(
"number" => 123456789,
"message" => "some *text*",
"media" => "video",
"url" => "https://some-site-example.mp4",
),
array(
"number" => 123456789,
"message" => "some *text*",
"media" => "document",
"url" => "https://some-site-example.doc",
"schedule_at" => "2024-07-10 15:30:00",
),
);
);
curl_setopt_array($curl, array(
CURLOPT_URL => '{{route('incoming.whatsapp.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);
//response will return data in this format
{
"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"
},
{
"uid": "0feb2a18-0e7f-4501-8929-51b069da",
"to": 123456789,
"status": "Pending",
"created_at": "2024-07-10 03:29 PM"
},
{
"uid": "36281c1d-05b6-4171-8d11-6e09c2ad",
"to": 123456789,
"status": "Schedule",
"created_at": "2024-07-10 03:29 PM"
}
]
}
{{ translate("This PHP method uses cURL to send email data to an API endpoint, receiving a") }}{{ translate(" JSON response ") }} {{ translate("with email request status and logs.") }}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{url('api/get/whatsapp/{uid}')}}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Api-key: ###########################,
),
));
$response = curl_exec($curl);
curl_close($curl);
//response will return data in this format
{
"success": true,
"message": "Successfully Fetched WhatsApp From Logs",
"data": {
"uid": "1ea910b9-bafb-41b1-82a5-bb8c750e",
"number": 123456789,
"content": {
"message_body": "some *text*"
},
"status": "Success",
"updated_at": "2024-07-10 03:31 PM"
}
}