The Releans SDK enables developers to use Releans Services in their code. You can get started in minutes.
composer require releans/releansapi
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.
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);
The singleton instance of the MessageController
class can be accessed from the API Client.
$message = $client->getMessage();
List all messages sent by the account.
function getAllMessages($accept)
Parameter | Tags | Description |
---|---|---|
accept | Required |
/ |
$accept = '*/*';
$result = $message->getAllMessages($accept);
Return the details of the message.
function getViewMessage(
$id,
$accept)
Parameter | Tags | Description |
---|---|---|
id | Required |
Message ID |
accept | Required |
/ |
$id = 'id';
$accept = '*/*';
$result = $message->getViewMessage($id, $accept);
Send a single message.
function createSendSMSMessage(
$accept,
$senderId,
$mobileNumber,
$body)
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. |
$accept = 'Accept';
$senderId = 'senderId';
$mobileNumber = 'mobileNumber';
$body = 'message';
$result = $message->createSendSMSMessage($accept, $senderId, $mobileNumber, $body);
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);
The singleton instance of the SenderController
class can be accessed from the API Client.
$sender = $client->getSender();
Return the details of the sender name.
function getSenderNameDetails(
$id,
$accept)
Parameter | Tags | Description |
---|---|---|
id | Required |
TODO: Add a parameter description |
accept | Required |
TODO: Add a parameter description |
$id = 'sender-id';
$accept = '*/*';
$result = $sender->getSenderNameDetails($id, $accept);
Create a new sender id to send messages using it
function createSenderName(
$accept,
$contentType,
$body)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
$accept = 'text/plain';
$contentType = 'text/plain';
$body = 'Your sender name';
$result = $sender->createSenderName($accept, $contentType, $body);
List all senders names associated with the account
function getAllSenders($accept)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
$accept = '*/*';
$result = $sender->getAllSenders($accept);
The singleton instance of the BalanceController
class can be accessed from the API Client.
$balance = $client->getBalance();
Get your available balance
function getBalance($accept)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
$accept = 'text/plain';
$result = $balance->getBalance($accept);
=======
The Releans SDK enables developers to use Releans Services in their code. You can get started in minutes.
composer require releans/php-client-sdk
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);
The singleton instance of the MessageController
class can be accessed from the API Client.
$message = $client->getMessage();
List all messages sent by the account.
function getAllMessages($accept)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
$accept = '*/*';
$result = $message->getAllMessages($accept);
Return the details of the message.
function getViewMessage(
$id,
$accept)
Parameter | Tags | Description |
---|---|---|
id | Required |
TODO: Add a parameter description |
accept | Required |
TODO: Add a parameter description |
$id = 'id';
$accept = '*/*';
$result = $message->getViewMessage($id, $accept);
Send a single message.
function createSendSMSMessage(
$accept,
$senderId,
$mobileNumber,
$message)
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. |
$accept = 'Accept';
$senderId = 'senderId';
$mobileNumber = 'mobileNumber';
$message = 'message';
$result = $message->createSendSMSMessage($accept, $senderId, $mobileNumber, $message);
The singleton instance of the SenderController
class can be accessed from the API Client.
$sender = $client->getSender();
Return the details of the sender name.
function getSenderNameDetails(
$id,
$accept)
Parameter | Tags | Description |
---|---|---|
id | Required |
TODO: Add a parameter description |
accept | Required |
TODO: Add a parameter description |
$id = 'sender-id';
$accept = '*/*';
$result = $sender->getSenderNameDetails($id, $accept);
Create a new sender id to send messages using it
function createSenderName(
$accept,
$contentType,
$body)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
$accept = 'text/plain';
$contentType = 'text/plain';
$body = 'Your sender name';
$result = $sender->createSenderName($accept, $contentType, $body);
List all senders names associated with the account
function getAllSenders($accept)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
$accept = '*/*';
$result = $sender->getAllSenders($accept);
The singleton instance of the BalanceController
class can be accessed from the API Client.
$balance = $client->getBalance();
Get your available balance
function getBalance($accept)
Parameter | Tags | Description |
---|---|---|
accept | Required |
TODO: Add a parameter description |
$accept = 'text/plain';
$result = $balance->getBalance($accept);