PHP code example of brolese / infobip-api-php-client
1. Go to this page and download the library: Download brolese/infobip-api-php-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/ */
brolese / infobip-api-php-client example snippets
$configuration = (new Configuration())
->setHost(URL_BASE_PATH)
->setApiKeyPrefix('Authorization', API_KEY_PREFIX)
->setApiKey('Authorization', API_KEY);
$client = new GuzzleHttp\Client();
$sendSmsApi = new SendSMSApi($client, $configuration);
$destination = (new SmsDestination())->setTo('41793026727');
$message = (new SmsTextualMessage())
->setFrom('InfoSMS')
->setText('This is a dummy SMS message sent using infobip-api-php-client')
->setDestinations([$destination]);
$request = (new SmsAdvancedTextualRequest())
->setMessages([$message]);
$previewResponse = $sendSmsApi->previewSmsMessage((new SmsPreviewRequest())
->setText("Let's see how many characters will remain unused in this message."));
echo $previewResponse;