2017 © Pedro Peláez
 

library client

PHP Client for using Mocean's API.

image

mocean/client

PHP Client for using Mocean's API.

  • Monday, July 30, 2018
  • by MoceanAPI
  • Repository
  • 0 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

MoceanAPI Client Library for PHP

Latest Stable Version Build Status codecov codacy StyleCI License Total Downloads, (*1)

This library requires a minimum PHP version of 5.5, (*2)

This is the PHP client library for use Mocean's API. To use this, you'll need a Mocean account. Sign up for free at moceanapi.com., (*3)

Installation

To use the client library you'll need to have created a Mocean account., (*4)

To install the PHP client library using Composer., (*5)

composer require mocean/client

Usage

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

require_once "vendor/autoload.php";

Create a client with your API key and secret:, (*7)

use Mocean\Client;
use Mocean\Client\Credentials\Basic;

$mocean = new Client(new Basic('API_KEY_HERE','API_SECRET_HERE'));

Example

To use Mocean's SMS API to send an SMS message, call the $mocean->message()->send(); method., (*8)

The API can be called directly, using a simple array of parameters, the keys match the parameters of the API., (*9)

$res = $mocean->message()->send([
    'mocean-to' => '60123456789',
    'mocean-from' => 'MOCEAN',
    'mocean-text' => 'Hello World'
]);

echo $res;

Responses

For your convenient, the API response data can be accessed either using php object style or array style, (*10)

echo $res;            //show full response string
echo $res['status'];  //show response status, '0' in this case
echo $res->status;    //same as above

Documentation

Kindly visit MoceanApi Docs for more usage, (*11)

License

This library is released under the MIT License, (*12)

The Versions

30/07 2018

dev-master

9999999-dev

PHP Client for using Mocean's API.

  Sources   Download

MIT

The Requires

 

The Development Requires

11/07 2018
05/07 2018

1.0.0.x-dev

1.0.0.9999999-dev

PHP Client for using Mocean's API.

  Sources   Download

MIT

The Requires

 

The Development Requires

05/07 2018
26/06 2018