1. Go to this page and download the library: Download tvce/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/ */
tvce / client example snippets
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\Call\CallService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new CallService($client);
$response = $service->call('NUMERO-A', 'NUMERO-B');
echo $response;
$client->close();
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\Call\CallService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new CallService($client);
$response = $service->getCall('ID_CHAMADA');
echo $response; // {}
$client->close();
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\Call\CallService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new CallService($client);
$response = $service->finish('ID_CHAMADA');
echo $response; // {}
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\SMS\SMSService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new SMSService($client);
$response = $service->send('NUMERO-DESTINO', 'MENSAGEM');
echo $response; // {}
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\TTS\TTSService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new TTSService($client);
$response = $service->send('NUMERO-DESTINO', 'MENSAGEM');
echo $response; // {}
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\Audio\AudioService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new AudioService($client);
$response = $service->send('NUMERO-DESTINO', 'MENSAGEM');
echo $response; // {}
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\Central\CentralService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new CentralService($client);
$response = $service->create();
echo $response; // {}
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
// Considero que já existe um autoloader compatível com a PSR-4 registrado
use Tvce\SocketClient;
use Tvce\Account\AccountService;
use Tvce\SocketClientException;
try {
$client = new SocketClient('{YOUR-ACCESS-TOKEN}', 'api.totalvoice.com.br');
$service = new AccountService($client);
$response = $service->get('ID_CONTA');
echo $response; // {}
} catch(SocketClientException $ex) {
echo $ex->getMessage();
}
composer
php composer.phar test
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.