PHP code example of myckhel / checkmobi

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

    

myckhel / checkmobi example snippets

 artisan vendor:publish --provider="Myckhel\CheckMobi\CheckMobiServiceProvider"



return [
  "secret_key"          => env("CHECKMOBI_SECRET_KEY"),
  "retry_after"         => 120, // option to set the retry limit for each phone number verification
    /* coming soon */
  "route_middleware"    => 'auth:api', // For injecting middleware to the package's routes
];

use CheckMobi;
use Myckhel\CheckMobi\Support\MissedCall;

CheckMobi::requestValidation($params);

CheckMobi::verifyValidation($params);

CheckMobi::getAccountDetails($params);

CheckMobi::getCountriesList($params);

CheckMobi::getPrefixes($params);

CheckMobi::checkNumber($params);

CheckMobi::validationStatus($validationId, $params);

CheckMobi::sendSMS($params);

CheckMobi::getSmsDetails($params);

CheckMobi::placeCall($params);

CheckMobi::getCallDetails($callId, $params);

CheckMobi::hangUpCall($callId, $params);

MissedCall::request($params);

MissedCall::verify($params);

use Myckhel\CheckMobi\Support\MissedCall;
use CheckMobi;

class VerificationController {

  public function request(){

    return MissedCall::request([
        'number'                  => '+1 234 567 890', // E. 164 format
        'platform'                => 'web',
    ]);
  }

  public function verify(){

    return MissedCall::verify([
        'id'    => 'SMS-FF9137C1-4D39-42B0-BE86-4B5A96CE13BD', // E. 164 format
        'pin'   => '9711',
    ]);
  }

  public function exampleCheckMobi(){

    $validationResponse = CheckMobi::requestValidation([
          'number'                  => '+1 234 567 890', // E. 164 format
          'type'                    => 'reverse_cli',
          'platform'                => 'web',
    ]);

    $verificationResponse = CheckMobi::verifyValidation([
      "id": "SMS-FF9137C1-4D39-42B0-BE86-4B5A96CE13BD", // $validationResponse->id
      "pin":"9711"
    ]);
  }
}
checkmobi.php