PHP code example of mocean / client7

1. Go to this page and download the library: Download mocean/client7 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mocean / client7 example snippets




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

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

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

echo $res;

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