Skip to main content

AILabTools API - Querying Async Task Results - API

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.

tip

Asynchronous task results are valid for 24 hours. It is recommended that asynchronous task results be queried every 5 seconds.

File Storage Policy

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

Request

  • URL: https://www.ailabapi.com/api/common/query-async-task-result
  • Method: GET
FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY. Get API KEY

Query

FieldRequiredTypeDescription
task_idYESstringThe task_id returned by the asynchronous API.

Response

Processing Flow
  1. Handle Public Parameters:

    First, parse and validate the Public Parameters, checking the status code or response message to ensure the request is successful and no errors are present.

  2. Handle Business Parameters:

    If the public parameters are valid and no exceptions are found, proceed to process the business logic in the Business Parameters.

Public Parameters

Viewing Public Parameters and Error Codes

Business Parameters

FieldTypeScopeDescription
task_statusinteger
  • 0
  • 1
  • 2
  • Asynchronous task status.
  • 0: The task is queued.
  • 1: Asynchronous processing.
  • 2: Processing was successful.
  • Example

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

    Code example