PHP code example of suare-su / suare-ferone_api_connector
1. Go to this page and download the library: Download suare-su/suare-ferone_api_connector 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/ */
suare-su / suare-ferone_api_connector example snippets
use GuzzleHttp\Client;
use SuareSu\FeroneApiConnector\Connector\Connector;
use SuareSu\FeroneApiConnector\Transport\TransportFactory;
// инициируем клиент
$guzzleClient = new Client();
// создаем транспорт с помощью фабрики
$transport = TransportFactory::new()
->setUrl('http://api.url/api/v2')
->setAuthKey('api_auth_key')
->createForGuzzleClient($guzzleClient);
// создаем коннектор и передаем в него объект транспорта
$connector = new Connector($transport);
// коннектор готов к использованию
$connector->pingApi();