01 What the functions do
These functions let you manage the robot task queue without the interface: view the tasks, queue a login or 2FA, remove what you do not need and restart what failed. It helps when you have a lot of accounts or when your own program runs the queue. How to call a function and read the response is in the API catalog.
- Watch the queue.
task/listreturns the tasks of one account or of all your accounts at once and filters them by type and status. Each task has a status, an error code, a counter of re-launches and the times it was queued, started and finished. - Find tasks with a problem and restart them. Filter
task/listbystatus=3(Problem), then bystatus=4(Error). Remove the cause, for example replace a proxy that does not work, and put the task back in the queue withtask/restart. - Queue a task.
task/addqueues a login (login) or turning on two-factor authentication (make2fa) for an account. Formake2fayou can set a delay in hours. If the account queue already holds the same unfinished task, the new one is not added. - Remove a task you do not need.
task/delremoves a task from the account queue and releases the task that follows it. System registration tasks and successfully completed tasks cannot be deleted.
02 Listing tasks
URLhttps://ggl.farm/api/task/list.json?id={apitoken}
Returns the tasks in the queue. With the acc parameter you get the tasks of one account. Without it you get the tasks of all your accounts. Tasks come in the order they were added, by ascending ID.
Parameters
| Field | Description |
|---|---|
acc | Account ID in GGL. If you pass it, only the tasks of that account are returned. |
type | Task type, by name (make2fa — 2FA, login — login) or by number (1 — Registration, 2 — Farm, 3 — Statistics, 4 — 2FA, 5 — Login). |
status | Task status: 0 — In queue, 1 — Waiting, 2 — Working, 3 — Problem, 4 — Error, 5 — Success. |
page | Page number, 1 by default. Pages are numbered from 1. |
show | How many tasks to return per page, 100 by default. There is no upper limit. |
Response
| Field | Description |
|---|---|
nav | Pagination. The fields are described below. |
dataset | Value dictionaries: types — task type names, statuses — task status names. The key in a dictionary is the number from the task fields. |
data | The tasks. It is an object: the key is the task ID, the value holds the task fields, which are described below. |
Fields of the nav block:
| Field | Description |
|---|---|
total | How many tasks in total. |
page | Current page. |
pages | How many pages. |
show | Tasks per page. |
Task fields:
| Field | Description |
|---|---|
id | Task ID in GGL. |
acc | ID of the account the task belongs to. |
type | Task type as a number. Look up the name in the dataset.types dictionary. |
status | Task status as a number. Look up the name in the dataset.statuses dictionary. |
error | Error code of the task run. 0 — no error. |
retry | How many times the task was re-launched. |
create | When the task was queued, UNIX timestamp. |
delay | The time from which the task can be launched, UNIX timestamp. 0 — it can run at once. |
start | When the task was last launched, UNIX timestamp. 0 — it has not run yet. |
finish | When the task last finished, UNIX timestamp. 0 — it has not finished yet. |
{
"status": "ok",
"nav": {
"total": 3,
"page": 1,
"pages": 1,
"show": 100
},
"dataset": {
"types": {
"1": "Registration",
"2": "Farm",
"3": "Statistics",
"4": "2FA",
"5": "Login"
},
"statuses": {
"0": "In queue",
"1": "Waiting",
"2": "Working",
"3": "Problem",
"4": "Error",
"5": "Success"
}
},
"data": {
"1041": {
"id": 1041,
"acc": 666,
"type": 5,
"status": 5,
"error": 0,
"retry": 0,
"create": 1754846400,
"delay": 0,
"start": 1754846500,
"finish": 1754849400
},
"1042": {
"id": 1042,
"acc": 666,
"type": 4,
"status": 1,
"error": 0,
"retry": 0,
"create": 1754850000,
"delay": 1754864400,
"start": 0,
"finish": 0
},
"1055": {
"id": 1055,
"acc": 671,
"type": 4,
"status": 4,
"error": 902,
"retry": 2,
"create": 1754760000,
"delay": 1754790000,
"start": 1754789000,
"finish": 1754789600
}
}
}
Errors
| Code | Description |
|---|---|
bad-id | No account with this ID is found. |
unpaid | Subscription not paid. |
03 Adding a task
URLhttps://ggl.farm/api/task/add.json?id={apitoken}
Queues a task on an existing account. There are two task types: make2fa turns on two-factor authentication and login logs into the account. The robot runs the tasks in the order of the account queue. It works like the task buttons in the account card.
Parameters
| Field | Description |
|---|---|
acc* | Account ID in GGL. |
type* | Task type: make2fa or login. |
delay | After how many hours to run the task. Fractions are allowed, for example 2.5. Only make2fa takes it into account. A login task is always queued to run at once. |
If an unfinished task of the same type is already in the account queue, the new one is not added.
Response
{ "status": "ok", "id": 1042 }
Errors
| Code | Description |
|---|---|
no-id | Account ID is not specified. |
bad-id | No account with this ID is found. |
no-type | Task type is not specified. |
bad-type | An unavailable task type is specified. |
duplicate | An unfinished task of this type is already in the account queue. |
unpaid | Subscription not paid. |
04 Deleting a task
URLhttps://ggl.farm/api/task/del.json?id={apitoken}&task={id}
Removes a task from the account queue and releases the task that follows it.
Parameters
| Field | Description |
|---|---|
task* | Task ID in GGL. |
System registration tasks cannot be deleted. Successfully completed tasks are not deleted either. They stay in the account history.
Response
{ "status": "ok" }
Errors
| Code | Description |
|---|---|
no-id | Task ID is not specified. |
bad-id | No task with this ID is found. |
system | A system registration task cannot be deleted. |
bad-status | A task with this status cannot be deleted. |
unpaid | Subscription not paid. |
05 Restarting a task
URLhttps://ggl.farm/api/task/restart.json?id={apitoken}&task={id}
Returns a task to the execution queue. Only tasks with the “Problem” and “Error” status are restarted. Such a task gets the “Waiting” status and the re-launch counter goes up.
Parameters
| Field | Description |
|---|---|
task* | Task ID in GGL. |
Before restarting, remove the cause of the failure, for example, replace a proxy that does not work.
Response
{ "status": "ok" }
Errors
| Code | Description |
|---|---|
no-id | Task ID is not specified. |
bad-id | No task with this ID is found. |
bad-status | A task with this status cannot be restarted. Only “Problem” and “Error” tasks are restarted. |
unpaid | Subscription not paid. |