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:
- Add a step "WAIT_FOR_VARIABLE_VALUE" to your template and specify the variable name as a permanent value.
- As all the variable values should be sent to createTask method, substitute the variable value with the string "_WAIT_FOR_IT_".
If your task creation request could look something like this:
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 the variable "my_late_variable" should look like this:
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. >0 - error identifier. Error code with short description are available in errorCode and errorDescription properties. |
errorCode | String | |
errorDescription | String | Short description of the error |
Response example
JSON with no errors
JSON with an error
{
"errorId":0,
"status":"success"
}