/php-sms-sdk

The Releans PHP SDK allow you to get up an running with Releans API quickly in your project. # What you can do with Releans Services? 1- Send emails 2- On-time SMS 3- Automation for reminders and appointments

Primary LanguagePHPOtherNOASSERTION

Getting started

The Releans SDK enables developers to use Releans Services in their code. You can get started in minutes.

composer require releans/releansapi

Create Releans Account

First, sign up for a Releans account if you don't already have one, and make a note of your API key on the dashboard API page.

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
oAuthAccessToken Your API KEY

API client can be initialized as following.

$oAuthAccessToken = 'oAuthAccessToken'; // OAuth 2.0 Access Token

$client = new ReleansAPILib\ReleansAPIClient($oAuthAccessToken);

Class Reference

List of Controllers

Class: MessageController

Get singleton instance

The singleton instance of the MessageController class can be accessed from the API Client.

$message = $client->getMessage();

Method: getAllMessages

List all messages sent by the account.

function getAllMessages($accept)

Parameters

Parameter Tags Description
accept Required /

Example Usage

$accept = '*/*';

$result = $message->getAllMessages($accept);

Method: getViewMessage

Return the details of the message.

function getViewMessage(
        $id,
        $accept)

Parameters

Parameter Tags Description
id Required Message ID
accept Required /

Example Usage

$id = 'id';
$accept = '*/*';

$result = $message->getViewMessage($id, $accept);

Method: createSendSMSMessage

Send a single message.

function createSendSMSMessage(
        $accept,
        $senderId,
        $mobileNumber,
        $body)

Parameters

Parameter Tags Description
accept Required Accept
senderId Required Sender id to send the message from.
mobileNumber Required The mobile number supposed to receive the message.
body Required Message text.

Example Usage

$accept = 'Accept';
$senderId = 'senderId';
$mobileNumber = 'mobileNumber';
$body = 'message';

$result = $message->createSendSMSMessage($accept, $senderId, $mobileNumber, $body);

Full Code Example Usage

use ReleansAPILib\APIException;
use ReleansAPILib\ReleansAPIClient;


$oAuthAccessToken = 'YOUR_API_KEY'; // OAuth 2.0 Access Token
$client = new ReleansAPIClient($oAuthAccessToken);
$message = $client->getMessage();
$accept = 'Accept';
$senderId = 'Sender_Name_ID';
$mobileNumber = '+44123456789';
$body = 'Hello from Releans';

$result = $message->createSendSMSMessage($accept, $senderId, $mobileNumber, $body);

Back to List of Controllers

Class: SenderController

Get singleton instance

The singleton instance of the SenderController class can be accessed from the API Client.

$sender = $client->getSender();

Method: getSenderNameDetails

Return the details of the sender name.

function getSenderNameDetails(
        $id,
        $accept)

Parameters

Parameter Tags Description
id Required TODO: Add a parameter description
accept Required TODO: Add a parameter description

Example Usage

$id = 'sender-id';
$accept = '*/*';

$result = $sender->getSenderNameDetails($id, $accept);

Method: createSenderName

Create a new sender id to send messages using it

function createSenderName(
        $accept,
        $contentType,
        $body)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description
contentType Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

$accept = 'text/plain';
$contentType = 'text/plain';
$body = 'Your sender name';

$result = $sender->createSenderName($accept, $contentType, $body);

Method: getAllSenders

List all senders names associated with the account

function getAllSenders($accept)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description

Example Usage

$accept = '*/*';

$result = $sender->getAllSenders($accept);

Back to List of Controllers

Class: BalanceController

Get singleton instance

The singleton instance of the BalanceController class can be accessed from the API Client.

$balance = $client->getBalance();

Method: getBalance

Get your available balance

function getBalance($accept)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description

Example Usage

$accept = 'text/plain';

$result = $balance->getBalance($accept);

Back to List of Controllers

=======

Getting started

The Releans SDK enables developers to use Releans Services in their code. You can get started in minutes.

composer require releans/php-client-sdk

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
oAuthAccessToken OAuth 2.0 Access Token

API client can be initialized as following.

$oAuthAccessToken = 'oAuthAccessToken'; // OAuth 2.0 Access Token

$client = new ReleansAPILib\ReleansAPIClient($oAuthAccessToken);

Class Reference

List of Controllers

Class: MessageController

Get singleton instance

The singleton instance of the MessageController class can be accessed from the API Client.

$message = $client->getMessage();

Method: getAllMessages

List all messages sent by the account.

function getAllMessages($accept)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description

Example Usage

$accept = '*/*';

$result = $message->getAllMessages($accept);

Method: getViewMessage

Return the details of the message.

function getViewMessage(
        $id,
        $accept)

Parameters

Parameter Tags Description
id Required TODO: Add a parameter description
accept Required TODO: Add a parameter description

Example Usage

$id = 'id';
$accept = '*/*';

$result = $message->getViewMessage($id, $accept);

Method: createSendSMSMessage

Send a single message.

function createSendSMSMessage(
        $accept,
        $senderId,
        $mobileNumber,
        $message)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description
senderId Required Sender id to send the message from.
mobileNumber Required The mobile number supposed to receive the message.
message Required Message text.

Example Usage

$accept = 'Accept';
$senderId = 'senderId';
$mobileNumber = 'mobileNumber';
$message = 'message';

$result = $message->createSendSMSMessage($accept, $senderId, $mobileNumber, $message);

Back to List of Controllers

Class: SenderController

Get singleton instance

The singleton instance of the SenderController class can be accessed from the API Client.

$sender = $client->getSender();

Method: getSenderNameDetails

Return the details of the sender name.

function getSenderNameDetails(
        $id,
        $accept)

Parameters

Parameter Tags Description
id Required TODO: Add a parameter description
accept Required TODO: Add a parameter description

Example Usage

$id = 'sender-id';
$accept = '*/*';

$result = $sender->getSenderNameDetails($id, $accept);

Method: createSenderName

Create a new sender id to send messages using it

function createSenderName(
        $accept,
        $contentType,
        $body)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description
contentType Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

$accept = 'text/plain';
$contentType = 'text/plain';
$body = 'Your sender name';

$result = $sender->createSenderName($accept, $contentType, $body);

Method: getAllSenders

List all senders names associated with the account

function getAllSenders($accept)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description

Example Usage

$accept = '*/*';

$result = $sender->getAllSenders($accept);

Back to List of Controllers

Class: BalanceController

Get singleton instance

The singleton instance of the BalanceController class can be accessed from the API Client.

$balance = $client->getBalance();

Method: getBalance

Get your available balance

function getBalance($accept)

Parameters

Parameter Tags Description
accept Required TODO: Add a parameter description

Example Usage

$accept = 'text/plain';

$result = $balance->getBalance($accept);

Back to List of Controllers