Debugging 2captcha.com

CAPTCHAFORUM

Administrator
Sometimes it can be hard to find to undrestand why our API returns an error code when you make a request that looks correct.

We provide a debugging method that can help you to find the root of the problem showing what exactly our API recevied from you.

The method can be used both on in.php and res.php API endpoints for any request.

Add an additional parameter debug_dump=1 to your request and our server will return a dump of request parameters that received by our API.

Request example:
Code:
https://2captcha.com/in.php?key=1abc234de56fab7c89012d34e56fa7b8&method=userrecaptcha&googlekey=6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-&json=1&header_acao=1&pageurl=http://mysite.com/page/with/recaptcha/&pingback=http://1.2.3.4/pingback_handler/&debug_dump=1

Response example:
Code:
array(8) {
  ["key"]=>
  string(32) "1abc234de56fab7c89012d34e56fa7b8"
  ["method"]=>
  string(13) "userrecaptcha"
  ["googlekey"]=>
  string(40) "6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-"
  ["json"]=>
  string(1) "1"
  ["header_acao"]=>
  string(1) "1"
  ["pageurl"]=>
  string(38) "http://mysite.com/page/with/recaptcha/"
  ["pingback"]=>
  string(32) "http://1.2.3.4/pingback_handler/"
  ["debug_dump"]=>
  string(1) "1"
}
array(0) {
}
array(0) {
}
{"status":0,"request":"ERROR_KEY_DOES_NOT_EXIST"}

Using this method you will be able to easily identify cases when your request contains invalid data or missing required parameters.