Skip to main content
GET
/
api
/
common
/
query-async-task-result
Querying Async Task Results
curl --request GET \
  --url https://www.ailabapi.com/api/common/query-async-task-result \
  --header 'ailabapi-api-key: <api-key>'
{
  "error_code": 0,
  "error_code_str": "",
  "error_msg": "",
  "error_detail": {
    "status_code": 200,
    "code": "",
    "code_message": "",
    "message": ""
  },
  "task_status": 0
}
For asynchronous interface, after calling the API, the returned result is not the real request result, you need to save the task_id in the returned result and then call this interface to get the real request result.Asynchronous task results are valid for 24 hours. It is recommended that asynchronous task results be queried every 5 seconds.

Request

  • URL: https://www.ailabapi.com/api/common/query-async-task-result
  • Method: GET

Headers

FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY. Get API KEY

Query Params

FieldRequiredTypeDescription
task_idYESstringThe task_id returned by the asynchronous API.

Response

Response Field Handling Flow
  1. Handle Public Response Fields Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.
  2. Handle Business Response Fields If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

FieldTypeScopeDescription
task_statusinteger0, 1, 2Asynchronous task status. 0`: The task is queued.` 1: Asynchronous processing. “2: Processing was successful.

Response Example

{
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "task_status":    0
}

Sample Code

File Storage Policy

  • Response Files:
    • Storage Duration: 24 hours.
    • Deletion Method: Automatic Deletion upon Timeout.

Async APIs

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Query Parameters

task_id
string

The task_id returned by the asynchronous API.

Response

200 - application/json

Success

The response is of type object.