PHP code example of steevenz / citcall

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

    

steevenz / citcall example snippets


use Steevenz\Citcall;

/*
 * --------------------------------------------------------------
 * Inisiasi Class Citcall
 *
 * @param string Username
 * @param string API Key
 * --------------------------------------------------------------
 */
 $citcall = new Citcall([
   'version'  => 'v3', // default v3
   'appName'  => 'My App',
   'userId'   => 'USERID',
   'senderId' => 'SENDERID',
   'apiKey'   => 'APIKEY',
   'retry'    => 5, // default 5
]);

/*
 * --------------------------------------------------------------
 * Melakukan send sms
 *
 * @param string Phone Number
 * @param string Text
 *
 * @return object|bool
 * --------------------------------------------------------------
 */
 $result = $citcall->send('082123456789','Testing Citcall SMS API');

/*
 * --------------------------------------------------------------
 * Melakukan missed call otp
 *
 * @param string Phone Number
 * @param int    Gateway number (1-5) (1 by default)
 * @param bool   Asyncronous Missed Call (false by default)
 *
 * @return object|bool
 * --------------------------------------------------------------
 */
 $result = $citcall->missedCallOtp('082123456789', 1, false);

/*
 * --------------------------------------------------------------
 * Melakukan send sms otp
 *
 * @param string  Phone Number
 * @param string  Token
 * @param seconds Expires
 *
 * @return object|bool
 * --------------------------------------------------------------
 */
 $result = $citcall->sendOtp('082123456789','KODE123', 3600);

/*
 * --------------------------------------------------------------
 * Melakukan verifikasi otp
 *
 * @param string  Transaction ID (TRXID)
 * @param string  Phone Number
 * @param string  Token
 *
 * @return object|bool
 * --------------------------------------------------------------
 */
 $result = $citcall->verifyOtp(123,'082123456789','KODE123');

/*
 * --------------------------------------------------------------
 * Mendapatkan callback result
 *
 * @return object
 * --------------------------------------------------------------
 */
$result = $citcall->getCallback();