# "Truy vấn các tác vụ dựa trên danh sách ID"

Nguồn: https://docs.openaihub.net/api-45208858/

> API origin: `https://api.openaihub.net`. Chọn đúng nhóm API và model. Thông số dưới đây là bản tham chiếu kỹ thuật; chưa phải kết quả kiểm thử từng endpoint bằng tài khoản của bạn.


## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /mj/task/list-by-condition:
    post:
      summary: Truy vấn các tác vụ dựa trên danh sách ID
      deprecated: false
      description: Truy vấn hàng loạt nhiều tác vụ theo danh sách ID.
      operationId: mj_task_list_by_condition
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Hình ảnh/Midjourney
        - Midjourney
      parameters:
        - name: Authorization
          in: header
          description: Khóa API Bearer
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - ids
              properties:
                ids:
                  type: array
                  items:
                    type: string
                  description: Danh sách ID
              x-apifox-orders:
                - ids
              x-apidog-orders:
                - ids
            examples:
              example_single:
                value:
                  ids:
                    - '1743326750223591'
                    - '1743326750223592'
                summary: example_single
                description: Danh sách tác vụ truy vấn theo lô
              id_single:
                value:
                  ids:
                    - '1743326750223591'
                summary: id_single
                description: Truy vấn các tác vụ dựa trên danh sách ID
      responses:
        '200':
          description: thành công
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: Mã trạng thái nghiệp vụ
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        action:
                          type: string
                          description: >-
                            Loại hành động (TƯỞNG TƯỢNG / NÂNG ĐỘ PHÂN GIẢI /
                            BIẾN THỂ, v.v.)
                        buttons:
                          type: array
                          items:
                            type: object
                            properties:
                              customId:
                                type: string
                                description: Mã định danh chuyển tiếp tùy chỉnh
                              emoji:
                                type: string
                                description: Định danh biểu tượng cảm xúc
                              label:
                                type: string
                                description: Nhãn hiển thị
                              style:
                                type: integer
                                description: Tham số phong cách
                              type:
                                type: integer
                                description: Kiểu
                            x-apifox-orders:
                              - customId
                              - emoji
                              - label
                              - style
                              - type
                            x-apidog-orders:
                              - customId
                              - emoji
                              - label
                              - style
                              - type
                          description: >-
                            Danh sách các nút thao tác (cho các hành động tiếp
                            theo)
                        description:
                          type: string
                          description: Mô tả tác vụ
                        failReason:
                          type: string
                          description: Ly do that bai
                        finishTime:
                          type: integer
                          description: Dấu thời gian hoàn tất (ms)
                        id:
                          type: string
                          description: Mã tác vụ
                        imageUrl:
                          type: string
                          description: URL ảnh được tạo
                        progress:
                          type: string
                          description: 'Phần trăm tiến độ (ví dụ: `25%`, `50%`)'
                        prompt:
                          type: string
                          description: Lời nhắc đã dùng
                        promptEn:
                          type: string
                          description: Lời nhắc bằng tiếng Anh (do MJ dịch)
                        startTime:
                          type: integer
                          description: Mốc thời gian bắt đầu (ms)
                        state:
                          type: string
                          description: Trường trạng thái được truyền nguyên vẹn
                        status:
                          type: string
                          enum:
                            - NOT_START
                            - SUBMITTED
                            - IN_PROGRESS
                            - FAILURE
                            - SUCCESS
                          description: Trạng thái tác vụ
                        submitTime:
                          type: integer
                          description: Gửi dấu thời gian (ms)
                      refName: MjTask
                      x-apifox-orders:
                        - action
                        - buttons
                        - description
                        - failReason
                        - finishTime
                        - id
                        - imageUrl
                        - progress
                        - prompt
                        - promptEn
                        - startTime
                        - state
                        - status
                        - submitTime
                      x-apidog-orders:
                        - action
                        - buttons
                        - description
                        - failReason
                        - finishTime
                        - id
                        - imageUrl
                        - progress
                        - prompt
                        - promptEn
                        - startTime
                        - state
                        - status
                        - submitTime
                    description: >-
                      Phần dữ liệu (thường là Base64 hoặc một đối tượng có cấu
                      trúc)
                refName: PostMjTaskListByConditionResponse
                x-apifox-orders:
                  - code
                  - data
                x-apidog-orders:
                  - code
                  - data
              examples:
                example:
                  summary: example
                  value:
                    code: 0
                    data:
                      - action: chuỗi
                        buttons:
                          - customId: chuỗi
                            emoji: chuỗi
                            label: chuỗi
                            style: 0
                            type: 0
                        description: chuỗi
                        failReason: chuỗi
                        finishTime: 0
                        id: string
                        imageUrl: chuỗi
                        progress: chuỗi
                        prompt: chuỗi
                        promptEn: chuỗi
                        startTime: 0
                        state: chuỗi
                        status: NOT_START
                        submitTime: 0
          headers: {}
          x-apidog-name: thành công
        '400':
          description: Yêu cầu không hợp lệ hoặc xác thực thất bại
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - message
                      - type
                    properties:
                      message:
                        type: string
                        description: Thông báo lỗi (thường kết thúc bằng mã yêu cầu)
                      type:
                        type: string
                        description: Loại lỗi; các lỗi cổng cục bộ thường là new_api_error
                        examples:
                          - new_api_error
                    x-apifox-orders:
                      - message
                      - type
                    x-apidog-orders:
                      - message
                      - type
                refName: NewApiError
                x-apifox-orders:
                  - error
                x-apidog-orders:
                  - error
              examples:
                example:
                  summary: example
                  value:
                    error:
                      message: >-
                        Yêu cầu không hợp lệ (mã yêu cầu:
                        20260805120000123456789AbCdEfGh)
                      type: new_api_error
          headers: {}
          x-apidog-name: Yêu cầu không hợp lệ hoặc xác thực thất bại
        '401':
          description: Khóa API bị thiếu hoặc không hợp lệ
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - message
                      - type
                    properties:
                      message:
                        type: string
                        description: Thông báo lỗi (thường kết thúc bằng mã yêu cầu)
                      type:
                        type: string
                        description: Loại lỗi; các lỗi cổng cục bộ thường là new_api_error
                        examples:
                          - new_api_error
                    x-apifox-orders:
                      - message
                      - type
                    x-apidog-orders:
                      - message
                      - type
                refName: NewApiError
                x-apifox-orders:
                  - error
                x-apidog-orders:
                  - error
              examples:
                example:
                  summary: example
                  value:
                    error:
                      message: >-
                        Mã thông báo không hợp lệ (request id:
                        20260805120000123456789AbCdEfGh)
                      type: new_api_error
          headers: {}
          x-apidog-name: Khóa API bị thiếu hoặc không hợp lệ
      security: []
      x-apidog-folder: OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Hình ảnh/Midjourney
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208858-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
