Git Product home page Git Product logo

sms-api-php's Introduction

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

sms-api-php's People

Contributors

umpirsky avatar octopush avatar

Watchers

James Cloos avatar Victor L avatar Edouard avatar Augustin F avatar

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.