PHP code example of finna / gateway-api
1. Go to this page and download the library: Download finna/gateway-api 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/ */
finna / gateway-api example snippets
use Finna\GatewayApi\GatewayClient;
use Finna\GatewayApi\ParameterException;
$secret = 'your api key here';
try {
$result = (new GatewayClient($secret))
->setSender('My-name') //You can of course set your phone number to allow replies
->setRecipients([12345678, 87654321])
->setMessage('Test message from GatewayClient')
->send();
error_log(print_r($result, true));
} catch (ParameterException $exception) {
error_log('Parameter exception: ' . $exception->getMessage());
} catch (Throwable $exception) {
error_log('Exception: ' . $exception->getMessage());
}