Giter Club home page Giter Club logo

vumasms's Introduction

VUMASMS Client Library for PHP

This library requires a minimum PHP version of 5.6

This is the PHP client library for use VumaSMS's API. To use this, you'll need a vumasms account. Sign up for free at vumasms.com. This is currently a beta release, see contributing for more information.

Installation

To use the client library you'll need to have created a VUMASMS account.

To install the PHP client library using Composer

composer require kreateyou/vumasms

Obtaining Api Keys

  • Loggin to your VumaSMS account.
  • Click on Setting on the left side menu
  • Click on Generate API credentials button
  • Save the Key and Secret on you app NOTE: vumaSMS will not store the api key or credentials it will generate new key every time please save the key for later use

Usage

If you're using composer, make sure the autoloader is included in your project's bootstrap file:

require_once "vendor/autoload.php";

Create a client with your API key and secret:

$client = new  \Vumasms\VumaSMS(API_KEY, API_SECRET);     

Examples

Sending A Message

To use VumaSMS's SMS API to send an SMS message, call the $client->send() method.

The API can be called directly, using a simple array of parameters, the keys are as follows.

    to                // array of receipients
    sender            // registered sender ID, default VUMA
    message           // message
    scheduled_date    // date to be sent can be Datetime or Cron Expression
    scheduled_type    // date or cron
$messageBag = [
    'to' => [2547XXXXXX],
    'sender' => VUMA,
    'message' => 'Test message from the vumaSMS PHP Client'
];
$message = $client->send($messageBag);

The API response json data can be is as follows.

{"success":true,"details":{"type":"outbox","status":"queued","payload":{"to":["2547XXXXXX"],"message":"Your verification code for PROJECT is 3434  \n","sender":"VUMA","scheduled_date":null,"scheduled_type":null},"created_by":"17","scheduled_at":null,"updated_at":"2018-04-18 10:14:22","created_at":"2018-04-18 10:14:22","sid":"36"}};

Laravel

To use the components in laravel 5.x Add the VumaSMS provider in your Providers

    Vumasms\Laravel\Providers\ServiceProvider::class,

Publish the Service provider as follow

  php artisan vendor:publish --provider "Vumasms\Laravel\Providers\ServiceProvider"

on your config folder locate the vumasms.php config change the key & secret configuration if your are usine .env configuration add your keys and secret in your .env file as follows

       # VUMA SETTINGS
        VUMA_API_KEY=<KEY>
        VUMA_API_SECRET=<SECRET>

To send SMS in laravel is as follows

    app("vumasms")->send($messageBag),

Contributing

To contribute to the library, docs, or examples, [create an issue][issues] or a pull request. Please only raise issues about features marked as working in the API coverage as the rest of the code is being updated.

License

This library is released under the MIT License

vumasms's People

Contributors

kreateyou avatar vuma-tech avatar

Stargazers

 avatar

Watchers

 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.