Skip to content

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

Notifications You must be signed in to change notification settings

vlefr/sms-api-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 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

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%