releans / php-client-sdk
The Releans SDK enables developers to use Releans Services in their code. You can get started in minutes.
Requires
- php: >=5.4.0
- ext-curl: ^7.1
- ext-json: ^1.5
- ext-mbstring: ^7.1
- apimatic/jsonmapper: ~1.3.0
- mashape/unirest-php: ~3.0.1
Requires (Dev)
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: ^2.7
This package is auto-updated.
Last update: 2019-09-16 19:56:30 UTC
README
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
MessageController
Get singleton instance
The singleton instance of the MessageController
class can be accessed from the API Client.
$message = $client->getMessage();
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);
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);
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);
SenderController
Get singleton instance
The singleton instance of the SenderController
class can be accessed from the API Client.
$sender = $client->getSender();
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);
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);
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);
BalanceController
Get singleton instance
The singleton instance of the BalanceController
class can be accessed from the API Client.
$balance = $client->getBalance();
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);