BedrockStreaming / octopush-sms-api-php

SMS API php files allowing you to send SMS in +190 countries. SMS marketing or alert.

Home Page:http://www.octopush.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Octopush API

Octopush SMS API PHP client.

Installation

The recommended way to install Octopush SMS API PHP client is through composer:

$ composer require octopush/sms-api

Usage

Sending simple SMS

<?php

$client = new Octopush\Api\Client('*****@example.com', '***API_KEY***');

$client->setSmsRecipients(['+336********']);
$client->setSmsSender('AnySender');

$client->send('Octopush - Send SMS like a PRO.');
array:9 [
  "error_code" => "000"
  "cost" => "0.049"
  "balance" => "0"
  "sending_date" => "1455291116"
  "number_of_sendings" => "1"
  "currency_code" => "€"
  "successs" => array:1 [
    "success" => array:4 [
      "recipient" => "+336*******"
      "country_code" => "FR"
      "cost" => "0.049"
      "sms_needed" => "1"
    ]
  ]
  "failures" => []
]

For more information see documentation.

Sending SMS with replies

<?php

$client = new Octopush\Api\Client('*****@example.com', '***API_KEY***');

$client->setSmsRecipients(['+336********']);
$client->setSmsSender('AnySender');
$client->setWithReplies();

$client->send('Octopush - Send SMS like a PRO.');

For more information see documentation.

Checking your credit

<?php

$client = new Octopush\Api\Client('*****@example.com', '***API_KEY***');

$client->getCredit();
array:2 [
  "error_code" => "000"
  "credit" => "0.18"
]

For more information see documentation.

Working examples

You can find working examples in examples directory.

Before running them, make sure to configure them by editing config.php file:

$ cp config.php.dist config.php

About

SMS API php files allowing you to send SMS in +190 countries. SMS marketing or alert.

http://www.octopush.com


Languages

Language:PHP 100.0%