PHP code example of masgeek / fuelrod-rest-api-client

1. Go to this page and download the library: Download masgeek/fuelrod-rest-api-client 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/ */

    

masgeek / fuelrod-rest-api-client example snippets


use Fuelrod\Fuelrod;

$client = new Fuelrod(
    username: 'your-username',
    password: 'your-password',
    baseUrl:  'https://api.fuelrod.co.ke',
);

$client = new Fuelrod(
    username: 'your-username',
    password: 'your-password',
    baseUrl:  'https://api.fuelrod.co.ke',
    apiKey:   'your-api-key',
);

$response = $client->singleSms([
    'to'      => '0712345678',   // or E.164: '+254712345678'
    'message' => 'Hello from Fuelrod!',
]);

// $response['status'] === 'success' | 'error'
// $response['data']   === decoded response body

$response = $client->plainSms([
    'to'      => '+254712345678',
    'message' => 'Hello from Fuelrod!',
]);

$response = $client->premiumSms([
    'to'      => '+254712345678',
    'message' => 'Hello from Fuelrod!',
]);