Skip to content

umpirsky/OctopushSMSBundle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%