Menu

pushAntiGateVariable:为创建 AntGate 任务提交变量值

AntiGate 任务有一种功能:变量值可在创建任务之后提交。要如此操作,请按以下步骤操作:

  1. 对模板添加步骤“WAIT_FOR_VARIABLE_VALUE”,然后以常设值的形式指定变量名称。
  2. 由于必须向 createTask 方法发送所有变量值,因此要将变量值替换为字符串“_WAIT_FOR_IT_”。

如果任务创建请求可能看似以下请求:

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

则变量“my_late_variable”的更新请求会看似以下请求:

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

地址: https://api.anti-captcha.com/pushAntiGateVariable
方法: POST
Content-type: application-json

请求属性

属性类型必须使用用途
clientKey字符串
taskId整数
name字符串变量名称
value不限已推迟的变量的值

回应结构

属性类型用途
errorId整数错误标识符。
0 - 无错误,操作成功完成。
>0 - 错误标识符。错误代码及其简短描述可在 errorCodeerrorDescription 属性中找到。
errorCode字符串
errorDescription字符串简短错误说明

回应示例

JSON 没有错误
JSON 有错误
{
    "errorId":0,
    "status":"success"
}