PHP code example of callpage / api-php
1. Go to this page and download the library: Download callpage/api-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/ */
callpage / api-php example snippets
// Install the library via PEAR or download the .zip file to your project folder.
// This line loads the library in case without composer
gets
$callpage = new \Callpage\ApiPhp\Callpage($apiKey, $widgetId); //callpage API instance
//wraps method in try catch block
try {
$callpage->callOrSchedule('+48570570570');
//call was successfully done, your logic come here
}
catch (\Exception $e) {
echo 'Something goes wrong! The reason: ' . $e->getMessage();
}