Tipi di task supportati
Metodi dell'API
Articoli
Tutorial
GitHub
Menù della documentazione

pushAntiGateVariable: invia un valore della variabile per il task AntiGate

I task AntiGate hanno una funzione: i valori della variabile possono essere inviati dopo, una volta che il task è creato. Per farlo, segui questi step:

  1. Aggiungi uno step "WAIT_FOR_VARIABLE_VALUE" al tuo modello e indica il nome della variabile come valore permanente.
  2. Poiché tutti i valori della variabile devono essere inviati al metodo createTask method, sostituisci il valore della variabile con una stringa "_WAIT_FOR_IT_".

Se la tua richiesta di creazione del task è così:

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
        

Allora una richiesta di aggiornamento variabile "my_late_variable" deve essere così:

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
        

Indirizzo: https://api.anti-captcha.com/pushAntiGateVariable
Metodo: POST
Content-type: application-json

Proprietà della richiesta

Proprietà Tipo Richiesto Scopo
clientKey Stringa
taskId Numero intero
name Stringa Nome della variabile
value Qualsiasi Valore della variabile posposta

Struttura di risposta

Proprietà Tipo Scopo
errorId Numero intero Identificatore dell'errore.
0: nessun errore, l'operazione è riuscita.
>1: identificatore dell'errore. Un codice di errore e una breve descrizione sono trasferite nelle proprietà errorCode e errorDescription.
errorCode Stringa
errorDescription Stringa Breve descrizione dell'errore

Esempio di risposta

JSON senza errori
          {
    "errorId":0,
    "status":"success"
}
        
JSON con un errore
          {
    "errorId": 1,
    "errorCode": "ERROR_KEY_DOES_NOT_EXIST",
    "errorDescription": "Account authorization key not found in the system"
}