PHP

PHP

We provide a library to make deploying services in PHP-based applications easy. You only need to install the library and call the services directly. In the article below, we explain how to use seamlessly this library.

Installation

We prepared a PHP-based library that you can install only with one comment in the terminal (or cmd in Windows). Using our service with this library would be really easier and you no longer need to implement this side of your application. you only need to call post-prepared functions.

1 composer require metabypass/php

Configuration

After you installed the library first you need to import it into your application:

1 2 use Metabypass\Metabypass; require 'vendor/autoload.php';

Now to connect your program to your Metabypass account, you need to set the following credentials from the Application section of your panel (if you delete your application, first generate a new one and then set new client_id and client_secret).


 

1 2 3 4 5 6 7 8 //get your credentials from https://app.metabypass.tech/application $clientId='YOUR_CLIENT_ID'; $clientSecret='YOUR_CLIENT_SECRET'; $email='YOUR_EMAIL'; $password='YOUR_PASSWORD'; //metabypass instance $metabypass=new Metabypass($clientId,$clientSecret,$email,$password);

Sample Code

Text Captcha
reCAPTCHA v2
reCAPTCHA v3
1 2 3 4 5 6 7 8 9 10 // you can pass base64 encoded image file or path of image file //$image='base64_encoded_image'; $image='./samples/icaptcha2.png'; //you can pass some optional params too. more details: https://app.metabypass.tech/docs.html?#api_3 $numeric=0; //default $minLen=0; //default $maxLen=0; //default $server_response=$metabypass->imageCaptcha($image,$numeric,$minLen,$maxLen); //complete response in an object var_dump($metabypass->imageCaptcha_result); //end result

Full documentation & samples in Github