1. Go to this page and download the library: Download esendex/sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
esendex / sdk example snippets
5
5
5
$message = new \Esendex\Model\DispatchMessage(
"WebApp", // Send from
"01234567890", // Send to any valid number
"My Web App is SMS enabled!",
\Esendex\Model\Message::SmsType
);
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex Account Reference
"[email protected]", // Your login email address
"password" // Your password
);
$service = new \Esendex\DispatchService($authentication);
$result = $service->send($message);
print $result->id();
print $result->uri();
5
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex Account Reference
"[email protected]", // Your login email address
"password" // Your password
);
$service = new \Esendex\InboxService($authentication);
$result = $service->latest();
print "Total Inbox Messages: {$result->totalCount()}";
print "Fetched: {$result->count()}";
foreach ($result as $message) {
print "Message from: {$message->originator()}, {$message->summary()}";
}
5
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex account reference
"[email protected]", // Your login email
"password" // Your password
);
$headerService = new \Esendex\MessageHeaderService($authentication);
$message = $headerService->message("messageId");
print_r($message->status());
5
$messageId = "unique-id-of-message";
$authentication = new \Esendex\Authentication\LoginAuthentication(
"EX000000", // Your Esendex Account Reference
"[email protected]", // Your login email address
"password" // Your password
);
$service = new \Esendex\MessageBodyService($authentication);
$result = $service->getMessageBodyById($messageId);
print $result;