PHP code example of citcall / api

1. Go to this page and download the library: Download citcall/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/ */

    

citcall / api example snippets




$citcall = new Citcall\Citcall(APIKEY);

$motp = $citcall->motp([
	'msisdn' => MSISDN,
	'gateway' => GATEWAY
]);

$motp = $citcall->motp([
	'msisdn' => MSISDN,
	'gateway' => GATEWAY,
	'valid_time' => TIME_VALID, //optional - valid time in seconds
	'limit_try' => LIMIT_TRY //optional - maximum attempt
	'callback_url' => CALLBACK_URL //Webhook URL where delivery status for the result will be posted (Overwrites your default account callback URL).
]);

print_r($motp);

$sms = $citcall->sms([
	'senderid' => 'citcall',
	'msisdn' => MSISDN,
	'text' => 'Test message from the Citcall PHP',
	'callback_url' => CALLBACK_URL //Webhook URL where delivery status for the result will be posted (Overwrites your default account callback URL).
]);

print_r($sms);

$smsotp = $citcall->smsotp([
	'senderid' => 'citcall',
	'msisdn' => MSISDN,
	'text' => 'Test message OTP from the Citcall PHP',
	'callback_url' => CALLBACK_URL //Webhook URL where delivery status for the result will be posted (Overwrites your default account callback URL).
]);

print_r($smsotp);

$verify = $citcall->verify([
	'msisdn' => MSISDN,
	'trxid' => TRXID,
	'token' => TOKEN
]);

print_r($verify);