2017 © Pedro Peláez
 

library sdk

Send SMS from your application using the Esendex API

image

esendex/sdk

Send SMS from your application using the Esendex API

  • Wednesday, January 3, 2018
  • by esendex
  • Repository
  • 50 Watchers
  • 20 Stars
  • 80,564 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 10 Forks
  • 2 Open issues
  • 19 Versions
  • 13 % Grown

The README.md

Esendex PHP Client

Build Status Latest Stable Version Latest Unstable Version License, (*1)

Installation

Requirements

  • PHP >= 7.3
  • ext-curl enabled

The esendex-php-sdk is available to install through several methods as well as from source., (*2)

Composer

{
    "require": {
        "esendex/sdk": "3.*.*"
    }
}

Composer is not included within the repository, so you will need to retrieve it using the following command:, (*3)

curl -sS https://getcomposer.org/installer | php

For installation on other platforms see getcomposer.org, (*4)

We're in the default Packagist repository so just run, (*5)

$ php composer.phar require esendex/sdk:3.*.*

or add the package above to your composer.json, (*6)

Then just include Composer's generated autoload.php somewhere in your code;, (*7)

require_once 'path/to/vendor/autoload.php';

GZIP

Download the current version here, (*8)

Our autoloader may be included somewhere in your application;, (*9)

require_once 'path/to/downloaded/sdk/src/Esendex/AutoLoad.php';

Getting Started

Sending SMS

$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
    "user@example.com", // Your login email address
    "password" // Your password
);
$service = new \Esendex\DispatchService($authentication);
$result = $service->send($message);

print $result->id();
print $result->uri();

Retrieving Inbox Messages

$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex Account Reference
    "user@example.com", // 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()}";
}

Track Message Status

$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex account reference
    "user@example.com", // Your login email
    "password" // Your password
);
$headerService = new \Esendex\MessageHeaderService($authentication);
$message = $headerService->message("messageId");
print_r($message->status());

Retrieving Full Message Body

$messageId = "unique-id-of-message";
$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex Account Reference
    "user@example.com", // Your login email address
    "password" // Your password
);
$service = new \Esendex\MessageBodyService($authentication);

$result = $service->getMessageBodyById($messageId);

print $result;

Would you like to know more?

Full REST API documentation can be found @ developers.esendex.com, (*10)

Testing

Unit Tests

You will need to install composer in order to acquire the pre-requisites. This can be achieved by the following command:, (*11)

$ curl -sS https://getcomposer.org/installer | php

To retrieve said pre-requisites execute the following:, (*12)

$ composer.phar install

A suite of tests can be found in the test directory. To run them use the phing build utility. e.g., (*13)

$ php vendor/bin/phing

Credentials Test

You can check your account credentials using a phing task we have provided. First, ensure dependencies have been installed with composer:, (*14)

$ composer.phar install

Run the check-access script:, (*15)

$ vendor/bin/phing check-access
Buildfile: /home/developer/esendex-php-sdk/build.xml

EsendexSDK > check-access:

Esendex Username ? user@example.com
Esendex Password ? secret
Account Reference? EX000000

    Account credentials OK!

BUILD FINISHED

Total time: 10.0000 seconds

Issues

We hope you don't run into any issues but if you should please make use of the issue tracker on github or send an email to support@esendex.com, (*16)

Feedback

Let us know what you think @esendex, (*17)

The Versions

03/01 2018

dev-master

9999999-dev http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

20/12 2017

dev-SMS-854_add_batchId_to_message_header

dev-SMS-854_add_batchId_to_message_header http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

27/04 2017

v2.1.0

2.1.0.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

07/03 2017

dev-add-support-for-voice-retries

dev-add-support-for-voice-retries http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

03/01 2017

v2.0.0

2.0.0.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

14/09 2016

v1.3.0

1.3.0.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

06/07 2016

v1.1.2

1.1.2.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

13/05 2016

v1.1.1

1.1.1.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

11/05 2016

v1.1.0

1.1.0.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

08/02 2016

v1.0.9

1.0.9.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

03/02 2016

v1.0.8

1.0.8.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

24/08 2015

v1.0.7

1.0.7.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

18/12 2014

v1.0.6

1.0.6.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

25/06 2014

v1.0.5

1.0.5.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

10/02 2014

v1.0.4

1.0.4.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

07/06 2013

v1.0.3

1.0.3.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

28/05 2013

v1.0.2

1.0.2.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

12/03 2013

v1.0.1

1.0.1.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests

11/03 2013

v1.0.0

1.0.0.0 http://developers.esendex.com

Send SMS from your application using the Esendex API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3
  • ext-curl *

 

The Development Requires

by Esendex Support

api rest sms restful requests