Tasks

Task object

Definition

Some endpoints do not return a direct response. Instead they return a task_id which will contain the results once ready. In most cases you will need to get the task until the status is not pending. The status will then either be:

  • success: in which case you can read the data field to access the expected response.

  • error: in which case the error field will contain an error message and the data field will be null.

Response

JSON
{
    "id": "269999729",
    "status": "success",
    "error": null,
    "date_created": "2018-03-10T20:38:12.818792Z",
    "date_updated": "2018-03-10T20:38:13.032942Z",
    "data": {
        "outputs": [
            {
                "labels": {
                    "discarded": [],
                    "predicted": [
                        {
                            "threshold": 0.025,
                            "label_id": 207,
                            "score": 0.952849746,
                            "label_name": "golden retriever"
                        }
                    ]
                }
            }
        ]
    },
    "subtasks": null
}

Get single task status

Definition

This endpoint retrieves the state of a given task.

TASK_ID=123
curl https://api.deepomatic.com/v0.7/tasks/${TASK_ID} \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}"

Arguments

Code sample

curl https://api.deepomatic.com/v0.7/tasks/269999729 \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}"

Response

It returns a task object.

JSON
{
    "id": "269999729",
    "status": "success",
    "error": null,
    "date_created": "2018-03-10T20:38:12.818792Z",
    "date_updated": "2018-03-10T20:38:13.032942Z",
    "data": {
        "outputs": [
            {
                "labels": {
                    "discarded": [],
                    "predicted": [
                        {
                            "threshold": 0.025,
                            "label_id": 207,
                            "score": 0.952849746,
                            "label_name": "golden retriever"
                        }
                    ]
                }
            }
        ]
    },
    "subtasks": null
}

Get multiple task status

Definition

Retrieve several tasks status given their IDs.

GET https://api.deepomatic.com/v0.7/tasks

Arguments

Code sample

curl https://api.deepomatic.com/v0.7/tasks?task_ids=269999729&task_ids=269999730 \
-H "X-API-KEY: ${DEEPOMATIC_API_KEY}"

Response

A paginated list of task objects.

JSON
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "269999729",
            "status": "success",
            "error": null,
            "date_created": "2018-03-10T20:38:12.818792Z",
            "date_updated": "2018-03-10T20:38:13.032942Z",
            "data": {
                "outputs": [
                    {
                        "labels": {
                            "predicted": [
                                {
                                    "threshold": 0.025,
                                    "label_id": 207,
                                    "score": 0.952849746,
                                    "label_name": "golden retriever"
                                }
                            ],
                            "discarded": []
                        }
                    }
                ]
            },
            "subtasks": null
        },
        {
            "id": "269999730",
            "status": "success",
            "error": null,
            "date_created": "2018-03-10T20:39:47.346716Z",
            "date_updated": "2018-03-10T20:39:47.553246Z",
            "data": {
                "outputs": [
                    {
                        "labels": {
                            "predicted": [
                                {
                                    "threshold": 0.025,
                                    "label_id": 207,
                                    "score": 0.952849746,
                                    "label_name": "golden retriever"
                                }
                            ],
                            "discarded": []
                        }
                    }
                ]
            },
            "subtasks": null
        }
    ]
}

Last updated