# Query Task Details

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/aiart/tasks/{taskId}:
    get:
      summary: Query Task Details
      deprecated: false
      description: >

        The **getTask** API endpoint is used to retrieve detailed information
        about a single task based on the `taskId`.  


        ## Important Notes  


        - **Task ID Accuracy**:  
          Ensure the accuracy of the `taskId` when making the request.  

        - **Task Completion Status**:  
          Only when the `status` is `1` (completed), will the `resultUrl` or `avatarResult` contain valid data.  

        - **API Key Security**:  
          Keep your API key secure and do not disclose it to others. Unauthorized access to your API key could compromise your application.  
      tags:
        - Reference
      parameters:
        - name: taskId
          in: path
          description: The taskId returned after submitting the task.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer <your api key>
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: '000: Success, 999: Unknown error'
                  data:
                    type: object
                    properties:
                      taskId:
                        type: string
                        description: The unique identifier of the task.
                      createTime:
                        type: integer
                      updateTime:
                        type: integer
                      status:
                        type: integer
                        description: |-
                          The status code of the task.
                          0 indicates the task is in progress.
                          1 indicates the task is completed.
                          2 indicates the task failed.
                      businessId:
                        type: string
                        description: >-
                          The identifier of the business or project associated
                          with this task.
                      type:
                        type: string
                        description: |-
                          The type of the task being performed. For example:
                          videoEnhancer indicates a video enhancement operation.
                          avatar indicates an avatar generation operation.
                      resultUrl:
                        type: string
                        description: >-
                          The URL of the image result. This URL can be used to
                          download the result.

                          This field is only valid when the status is 1
                          (completed).
                      hasHsfw:
                        type: boolean
                        description: >-
                          Indicates whether harmful or sensitive content has
                          been detected.

                          false means no sensitive content was detected.

                          true means sensitive content was detected.
                      avatarResult:
                        type: array
                        items:
                          type: object
                          properties:
                            templateId:
                              type: string
                              description: >-
                                The ID of the template used to generate the
                                avatar.
                            images:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  url:
                                    type: string
                                    description: The URL address of the avatar image.
                                  hasHsfw:
                                    type: boolean
                                    description: >-
                                      Indicates whether harmful or sensitive
                                      content was detected in the generated
                                      avatar.

                                      false means no sensitive content was
                                      detected.

                                      true means sensitive content was detected.
                                required:
                                  - id
                                  - url
                                  - hasHsfw
                                x-apifox-orders:
                                  - id
                                  - url
                                  - hasHsfw
                              description: >-
                                An array of image information for the generated
                                avatar. This array may contain multiple avatars
                                in different sizes or formats.
                          required:
                            - templateId
                            - images
                          x-apifox-orders:
                            - templateId
                            - images
                        description: >-
                          The result of the generated avatar (headshot). If the
                          type is avatar, this object will be returned.
                          Otherwise, this field may be absent or null.
                    required:
                      - taskId
                      - createTime
                      - updateTime
                      - status
                      - businessId
                      - type
                      - resultUrl
                      - hasHsfw
                    x-apifox-orders:
                      - taskId
                      - createTime
                      - updateTime
                      - status
                      - businessId
                      - type
                      - resultUrl
                      - hasHsfw
                      - avatarResult
                required:
                  - code
                  - data
                x-apifox-orders:
                  - code
                  - data
              example:
                code: '000'
                msg: success
                data:
                  taskId: 6cf0082eba5044f1a9495e0eaf5e35ca
                  createTime: 1732588068355
                  updateTime: 1732588143312
                  status: 1
                  businessId: 75f15294e55540e198bb19cc0a068fd2
                  type: avatar
                  resultUrl: ''
                  hasHsfw: false
                  avatarResult:
                    - templateId: d691196a-6daa-4bf9-a011-5422d95ce03f
                      images:
                        - id: 4a19223cef7b4094a4f66c7de57f7ef4
                          url: >-
                            https://static.fotor.com.cn/aigc/business/75f15294e55540e198bb19cc0a068fd2/avatar/20241126/4a19223cef7b4094a4f66c7de57f7ef4.jpg
                          hasHsfw: false
                    - templateId: 74d8ef37-4864-480b-927a-dde52e429609
                      images:
                        - id: e20cb71b42474fc1a0750cb7627720b5
                          url: >-
                            https://static.fotor.com.cn/aigc/business/75f15294e55540e198bb19cc0a068fd2/avatar/20241126/e20cb71b42474fc1a0750cb7627720b5.jpg
                          hasHsfw: false
                    - templateId: 7292c5b5-ecb0-4868-b4a4-849c73cc302c
                      images:
                        - id: a2773ff7d3534a6ca8735ef7ad4f3f3d
                          url: >-
                            https://static.fotor.com.cn/aigc/business/75f15294e55540e198bb19cc0a068fd2/avatar/20241126/a2773ff7d3534a6ca8735ef7ad4f3f3d.jpg
                          hasHsfw: false
          headers: {}
          x-apifox-name: success
      security: []
      x-apifox-folder: Reference
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5562290/apis/api-240777233-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api-b.fotor.com
    description: 正式环境
security: []

```
