PHP code example of capy / capy_api_client

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

    

capy / capy_api_client example snippets

sh
switch ($result) {
    case PuzzleConst::Success:
      rint "1";
        break;
    case PuzzleConst::IncorrectAnswer:
        print "2";
        break;
    case PuzzleConst::InvalidRequestMethod:
        print "3";
        break;
    case PuzzleConst::InvalidPostParameters:
        print "4";
        break;
    case PuzzleConst::InvalidPrivateKey:
        print "5";
        break;
    case PuzzleConst::InvalidChallengeKey:
        print "6";
        break;
    case PuzzleConst::InvalidCaptchaKey:
        print "7";
        break;
    case PuzzleConst::InvalidOnetimeCaptcha:
        print "8";
        break;
    case PuzzleConst::IsNotActive:
        print "9";
        break;
    case PuzzleConst::UnknownError:
        print "2";
        break;
    case PuzzleConst::Timeout:
        print "2";
        break;
}
sh
switch ($result){
    case AvatarConst::Success;
        print "1";
        break;
    case AvatarConst::IncorrectAnswer;
        print "2";
        break;
    case AvatarConst::InvalidRequestMethod;
        print "3";
        break;
    case AvatarConst::InvalidPostParameters;
        print "4";
        break;
    case AvatarConst::InvalidChallengeKey;
        print "5";
        break;
    case AvatarConst::IsNotActive;
        print "6";
        break;
    case AvatarConst::UnknownError;
        print "7";
        break;
    case AvatarConst::Timeout;
        print "8";
        break;
}
sh
switch ($result["result"]) {
    case BlacklistConst::TooManySuccesses:
        print "1";
        break;
    case BlacklistConst::TooMayFailures:
        print "2";
        break;
    case BlacklistConst::NotFound:
        print "3";
        break;
    case BlacklistConst::FoundButExpired:
        print "4";
        break;
    case BlacklistConst::InWhiteList:
        print "5";
        break;
    case BlacklistConst::InvalidParameters:
        print "6";
        break;
    case BlacklistConst::InvalidIpAddress:
        print "7";
        break;
    case BlacklistConst::InvalidPrivateKey:
        print "8";
        break;
    case BlacklistConst::InvalidBlacklistKey:
        print "9";
        break;
    case BlacklistConst::CalculationError:
        print "10";
        break;
    case BlacklistConst::TimeOut:
        print "11";
        break;
    case BlacklistConst::Others:
        print "12";
        break;
    case BlacklistConst::UnknownError:
        print "13";
        break;
}
sh
switch ($result["result"]) {
    case RiskbaseConst::Success;
        print "1";
        break;
    case RiskbaseConst::InvalidParameters;
        print "2";
        break;
    case RiskbaseConst::IncorrectParameters;
        print "3";
        break;
    case RiskbaseConst::InvalidPrivateKey;
        print "4";
        break;
    case RiskbaseConst::InvalidUsername;
        print "5";
        break;
    case RiskbaseConst::EvaluationError;
        print "6";
        break;
    case RiskbaseConst::DataBaseError;
        print "7";
        break;
    case RiskbaseConst::NotInDataBase;
        print "8";
        break;
    case RiskbaseConst::BadRequest;
        print "9";
        break;
    case RiskbaseConst::TimeOut;
        print "10";
        break;
    case RiskbaseConst::UnknownError;
        print "11";
        break;
}