1. Go to this page and download the library: Download topsms/topsms-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/ */
topsms / topsms-php example snippets
TopSms\TopSmsClient;
use TopSms\TopSmsException;
// Client ID a Secret najdete v dashboardu: https://www.topsms.cz/dashboard/api
$client = new TopSmsClient('VAS_CLIENT_ID', 'VAS_SECRET');
try {
$result = $client->send('+420601234567', 'Vase objednavka #1024 je na ceste.', 'MojeFirma');
echo "Odesláno, ID: {$result['id']}, cena: {$result['price']} Kč\n";
} catch (TopSmsException $e) {
echo "Chyba ({$e->getHttpCode()}): {$e->getMessage()}\n";
}