Git Product home page Git Product logo

releans / php-sms-sdk Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.49 MB

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

Home Page: https://releans.com

License: Other

PHP 100.00%
sms-api sms-gateway sms-notifications sms-verification sms-sdk sms-service sms-messages sms-client sms

php-sms-sdk's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.