PHP code example of pluritech-total-voice / total-voice-php

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

    

pluritech-total-voice / total-voice-php example snippets






use \Exception;
use TotalVoicePhp\TotalVoicePhp as TotalVoicePhp;

private $totalVoiceSMS = null;

$account       = array('token' => 'your_token', 'url' => 'api_endpoint');
$totalVoicePhp = new TotalVoicePhp('TotalVoiceSMS',$account);//TotalVoiceSMS - determine that a class responsible for send SMS will be instantiated
$this->totalVoiceSMS = $totalVoicePhp->getMyClass();

$data = array(
    'number_destiny'  => $number, 
    'message'         => $message,
    'user_can_answer' => false,
    'multi_sms'       => false
);

$this->totalVoiceSMS->setSMSEntity($data);
$response = $this->totalVoiceSMS->send();