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:
- Aggiungi uno step "WAIT_FOR_VARIABLE_VALUE" al tuo modello e indica il nome della variabile come valore permanente.
- 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 -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 -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 | Sì | |
taskId | Numero intero | Sì | |
name | Stringa | Sì | Nome della variabile |
value | Qualsiasi | Sì | 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
JSON con un errore
{
"errorId":0,
"status":"success"
}