PHP code example of goxens / goxens-v2-php

1. Go to this page and download the library: Download goxens/goxens-v2-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/ */

    

goxens / goxens-v2-php example snippets




$auth = new Goxens\GoxensV2Php\Auth();
$jwt = $auth->generateToken('[email protected]', 'yourpassword');

$balance = new Goxens\GoxensV2Php\Balance();
$balance->getBalance($jwt); // ou $balance->getBalance($apiKey);

    $sender = new Goxens\GoxensV2Php\Sender();
    $senderName = $sender->createSender('My Sender', $token);

    $sender = new Goxens\GoxensV2Php\Sender();
    $senderList = $sender->findSenders($token);

    $sender = new Goxens\GoxensV2Php\Sender();
    $sender->deleteSender($senderId, $token);

    // Pour générer un jeton d'authentification
    $auth = new Goxens\GoxensV2Php\Auth();
    $token = $auth->generateToken('[email protected]', 'yourpassword');
 
    
    // Pour envoyer un SMS
    $simplesend = new Goxens\GoxensV2Php\Simplesend();
    $data = [
        "sender" => "My Sender",
        "typeContact" => "compose",
        "listeContacts" => "22991107506",
        "message" => "Bonjour",
        "hasSchedule" => false,
        "programDate" => null,
        "programTime" => null,
        "typeSmsSend" => "standard"
    ];
   
    $sendResult = $simplesend->sendSimpleSend($data, $token);
bash
composer