pushAntiGateVariable: invia un valore variabile per attività AntiGate
Le attività AntiGate hanno una funzione: i valori variabili possono essere inviati più tardi, dopo che un'attività è stata creata. Per fare ciò, segui questi passaggi:
- Aggiungi un passaggio "WAIT_FOR_VARIABLE_VALUE" al tuo modello e specifica il nome della variabile come valore permanente.
- Come tutti i valori delle variabili deve essere inviato al metodo createTask, sostituisci il valore della variabile con una stringa "_WAIT_FOR_IT_".
Se la tua richiesta di creazione dell'attività potrebbe apparire più o meno 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/createTaskAllora la richiesta di aggiornamento della variabile "my_late_variable" dovrebbe apparire 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/pushAntiGateVariableIndirizzo: https://api.anti-captcha.com/pushAntiGateVariable
Metodo: POST
Content-type: application-json
Richiedi proprietà
| Proprietà | Tipo | Richiesto | Scopo |
|---|---|---|---|
| clientKey | Stringa | Sì | |
| taskId | Intero | Sì | |
| name | Stringa | Sì | Nome della variabile |
| value | Tutti | Sì | Valore della variabile spostata |
Struttura risposta
| Proprietà | Tipo | Scopo |
|---|---|---|
| errorId | Intero | Identificatore errore. 0 - nessun errore, operazione completata con successo. >0 - Identificatore errore. Il codice errore e una sua breve descrizione sono disponibili 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"
}