Queues

A queue represents a manual process and works like a queue

The following parameters might be required as part of the request URL:

  • Organization ID. Visible in Settings.

  • Queue ID. Found in the URL when inside a queue.

A queue is denoted as an object with the following fields:

  • active_users: A list with the names of the users currently assigned to at least one pending task in the queue.

  • created_at: The queue's creation timestamp.

  • id: The queue's identifier.

  • n_tasks: The number of pending tasks in the queue, waiting to be completed.

  • name: The queue title.

  • data: The queue's data configuration, which consists of a list of Block objects. This field is only included when explicitly fetching a queue by its identifier.

Here is an example of how a queue object looks like:

{
    "active_users": [
        "Bernat"
    ],
    "created_at": "2020-10-23T11:03:48.542064Z",
    "data": [
        {
            "id": "paragraph",
            "name": "Paragraph",
            "text": {
                "placeholder": "What is going on?"
            },
            "type": "text"
        },
        {
            "id": "categories",
            "name": "Categories",
            "single_selection": {
                "is_required": true,
                "options": [
                    {
                        "id": "red",
                        "name": "Red"
                    },
                    {
                        "id": "blue",
                        "name": "Blue"
                    },
                    {
                        "id": "green",
                        "name": "Green"
                    }
                ]
            },
            "type": "single_selection"
        },
        {
            "id": "picture",
            "image": {
                "placeholder": "https://i.imgur.com/3FlrkQd.jpg"
            },
            "name": "Picture",
            "type": "image"
        }
    ],
    "description": "",
    "id": 169,
    "n_tasks": 2,
    "name": "Categorization"
}

List all queues

GET https://api.humanlambdas.com/orgs/$ORGANIZATION_ID/queues

Lists all queues that exist within the organization.

Path Parameters

Headers

[
    {
        "active_users": [
            "Bernat"
        ],
        "created_at": "2020-11-20T17:20:43.444360Z",
        "id": 213,
        "n_tasks": 2,
        "name": "Wikipedia"
    },
    {
        "active_users": [
            "Bernat"
        ],
        "created_at": "2020-10-23T11:03:48.542064Z",
        "id": 169,
        "n_tasks": 2,
        "name": "Categorization"
    },
    {
        "active_users": [],
        "created_at": "2020-11-24T10:56:13.779387Z",
        "id": 218,
        "n_tasks": 0,
        "name": "Lead Gen Requests"
    }
]

Sample request:

curl https://api.humanlambdas.com/orgs/$ORG_ID/queues \
-H "Authorization: Token $API_KEY"

Get queue by ID

GET https://api.humanlambdas.com/orgs/$ORGANIZATION_ID/queues/$QUEUE_ID

Retrieves a queue's information given a queue identifier.

Path Parameters

Headers

{
    "active_users": [
        "Bernat"
    ],
    "created_at": "2020-10-23T11:03:48.542064Z",
    "data": [
        {
            "id": "paragraph",
            "name": "Paragraph",
            "text": {
                "placeholder": "What is going on?"
            },
            "type": "text"
        },
        {
            "id": "categories",
            "name": "Categories",
            "single_selection": {
                "is_required": true,
                "options": [
                    {
                        "id": "red",
                        "name": "Red"
                    },
                    {
                        "id": "blue",
                        "name": "Blue"
                    },
                    {
                        "id": "green",
                        "name": "Green"
                    }
                ]
            },
            "type": "single_selection"
        },
        {
            "id": "picture",
            "image": {
                "placeholder": "https://i.imgur.com/3FlrkQd.jpg"
            },
            "name": "Picture",
            "type": "image"
        }
    ],
    "id": 169,
    "n_tasks": 2,
    "name": "Categorization"
}

Flush a queue

PUT https://api.humanlambdas.com/orgs/$ORGANIZATION_ID/queues/$QUEUE_ID/flush

Deletes all tasks in a queue whose status is not completed. Successful requests will result in an empty task queue.

Path Parameters

Headers

Last updated