Download the PHP package capy/capy_api_client without Composer
On this page you can find all versions of the php package capy/capy_api_client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download capy/capy_api_client
More information about capy/capy_api_client
Files in capy/capy_api_client
Package capy_api_client
Short Description Capy PHP HTTP client library makes verify puzzle/avatar and evaluate blacklist/riskbase for capy's services become easier
License MIT
Informations about the package capy_api_client
capy-api-php-client
Capy PHP client library makes verify puzzle/avatar and evaluate blacklist/riskbase for capy's services become easier:
Installation
The Capy PHP library client Provider can be installed via Composer by requiring the capy/capy_api_client package in your project's composer.json .
or
Require this package with composer:
Usage
I. Puzzle verify:
Step 1: Create new instance
$puzzleClient = new PuzzleClient($privateKey, $timeout);
With parameters:
- $privateKey: An API key is a key used for verifying site ownership. It can be obtained from show privatekey
- $timeOut : Request to server CAPY is Timeout (seconds)
Step 2: Implement verify
- $result = $puzzleClient.verify($capy_challengekey, $capy_answer)
With parameters:
- $capy_chanllengekey = $_POST['capy_challengekey'];
- $capy_answer = $_POST['capy_answer'];
Step 3: Handle data result
II. Avatar verify:
Step 1: Create new instance
$avatarClient = new AvatarClient($privateKey, $timeout);
With parameters:
- $privateKey: An API key is a key used for verifying site ownership. It can be obtained from show privatekey
- $timeOut : Request to server CAPY is Timeout (seconds)
Step 2: Implement verify
- $result = $avatarClient.verify($capy_challengekey, $capy_answer)
With parameters:
- $capy_chanllengekey = $_POST['capy_challengekey'];
- $capy_answer = $_POST['capy_answer'];
Step 3: Handle data result
III. Blacklist evaluate:
Step 1: Create new instance
$blacklistClient = new BlacklistClient($apiKey, $timeout, $blacklist_key);
With parameters:
- $apiKey: An API key is a key used for verifying site ownership. It can be obtained from show api key
- $timeOut : Request to server CAPY is Timeout (seconds)
- $blacklist_key = The key will get from capy server show blacklist key ;
Step 2: Implement verify
- $result = $blacklistClient.evaluate($ip_address)
With parameters:
- $ip_address = $_POST['ip_address'];
$result value:
- ["result"=>BlacklistConst::TooManySuccesses, "value"=>0.1]
Step 3: Handle data result
IV. Riskbase evaluate:
Step 1: Create new instance
$riskbaseClient = new RiskbaseClient($apiKey, $timeout, $riskbase_key);
With parameters:
- $apiKey: An API key is a key used for verifying site ownership. It can be obtained from show api key
- $timeOut : Request to server CAPY is Timeout (seconds)
- $riskbase_key = The key will get from capy server show riskbase key ;
Step 2: Implement verify
- $result = $riskbaseClient.evaluate($capy_data)
With parameters:
- $capy_data = $_POST['capy_data'];
$result value:
- ["result"=>RiskbaseConst::Success, "value"=>0.7, "reasons"=>[RiskbaseConst::DifferentISP, RiskbaseConst::DifferentCountry]]
Step 3: Handle data result