PHP code example of spryng / spryng-api-http-php

1. Go to this page and download the library: Download spryng/spryng-api-http-php 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/ */

    

spryng / spryng-api-http-php example snippets




use SpryngApiHttpPhp\Client;

$spryng = new Client('username', 'password', 'My Company');



$spryng = new Client('username', 'password', 'My Company');



use SpryngApiHttpPhp\Client;

$spryng = new Client('username', 'password', 'My Company');

try 
{
    $spryng->sms->send('31612345678', 'A sample message!', array(
        'route'     => 'business',
         'allowlong' => true
         'reference' => 'ABC123456789'
         'rawencoding' => false)
    );
}
catch (InvalidRequestException $e)
{
    echo $e->getMessage();
}



use SpryngApiHttpPhp\Client;

$spryng = new Client('username', 'password', 'My Company');

echo 'Current credit balance: ' . $spryng->sms->checkBalance();