Supported task types
API methods
Articles
Tutorials
GitHub
Documentation menu

pushAntiGateVariable: submit a variable value for AntiGate task

AntiGate tasks have a feature: variable values can be submitted later, after a task was created. To do this, follow these steps:

  1. Add a step "WAIT_FOR_VARIABLE_VALUE" to your template and specify variable name as a permanent value.
  2. As all the variable values should be sent to createTask method, substitute variable value with a string "_WAIT_FOR_IT_".

If your task creation request could look something like this:

CURL
          curl -i -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -X POST -d '{
    "clientKey":"YOUR_API_KEY",
    "task":
        {
            "type":"AntiGateTask",
            "websiteURL":"https://some-website.com/path",
            "templateName":"Template name here",
            "variables": {
                "my_late_variable":"_WAIT_FOR_IT_",
                "other_var1":"some value",
                "other_var2":"some value"
            }
        }
}' https://api.anti-captcha.com/createTask
        

Then a request updating variable "my_late_variable" should look like this:

CURL
          curl -i -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -X POST -d '{
    "clientKey":"YOUR_API_KEY",
    "taskId":123456,
    "name":"my_late_variable",
    "value":"The value which worker should be waiting for"
}' https://api.anti-captcha.com/pushAntiGateVariable
        

Address: https://api.anti-captcha.com/pushAntiGateVariable
Method: POST
Content-type: application-json

Request properties

Property Type Required Purpose
clientKey String Yes
taskId Integer Yes
name String Yes Name of the variable
value Any Yes Value of the postponed variable

Response structure

Property Type Purpose
errorId Integer Error identifier.
0 - no errors, operation completed successfully.
>1 - error identifier. Error code and short description transferred in errorCode and errorDescription properties.
errorCode String
errorDescription String Short description of the error

Response example

JSON with no errors
          {
    "errorId":0,
    "status":"success"
}
        
JSON with an error
          {
    "errorId": 1,
    "errorCode": "ERROR_KEY_DOES_NOT_EXIST",
    "errorDescription": "Account authorization key not found in the system"
}