get_task_history

imerit_ango.sdk.SDK.

get_task_history(task_history_id, task_id)

Get the stage history of a task.

Parameters

  • task_history_id: string, optional, default None

    • Optionally, the ID of the stage history item.

    • For example, if you run this function on a task without passingtask_history_id, assuming the task has been through 6 stages, you will receive a list with 6 objects. Each of these objects has its own _id value. If you pass this _id value as the task_history_id parameter, you can filter out all tak stage history items and only return the one with this specific ID.

    • Example: '0000000aa0a00a0000aaaa0a'

  • task_id: string

    • ID of the task to get the history of. Task IDs can be obtained from the UI, and from get_tasks.

    • Example: '0000000aa0a00a0000aaaa0a'

Returns:

  • output: dict

Sample Output
{
  "status": "success",
  "data": {
    "taskHistory": {
      "answer": {
        "tools": [
          {
            "bounding-box": {
              "x": 1094.0928805593353,
              "y": 929.222117890566,
              "height": 112.31541717796104,
              "width": 242.29578986936937
            },
            "objectId": "68174969c44e1ef63301642",
            "classifications": [],
            "schemaId": "a3f7ff90ae260c29132f063",
            "metadata": {
              "createdAt": "2023-05-04T08:14:14.642Z",
              "createdBy": "lorenzo@ango.ai",
              "createdIn": "Label"
            },
            "title": "Amount"
          }
        ],
        "classifications": [],
        "relations": []
      },
      "deleted": false,
      "rework": false,
      "batches": [],
      "isSkipped": false,
      "_id": "6464b15e4ea9720015801e07",
      "labelTaskId": "6453677fc47af30015be5a58",
      "createdAt": "2023-05-04T08:06:23.734Z",
      "project": "645240ed462db80015ce881f",
      "organization": "64461ed038dcad0015cc2049",
      "asset": "6453677fc47af30015be5a57",
      "stage": "77dc1c42-6fef-4745-b783-d6c4d99204e1",
      "duration": 1681,
      "updatedAt": "2023-05-17T10:50:06.211Z",
      "updatedBy": "lorenzo@ango.ai",
      "assignee": "lorenzo@ango.ai",
      "brushDataUrl": null,
      "__v": 0
    }
  }
}

Example

Get the task history of a specific task.

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')

ango_sdk = SDK(api_key)

task_id = "<YOUR TASK ID>"
sdk_response = ango_sdk.get_task_history(task_id=task_id)

See also

get_task

Last updated