Fotor OpenAPI
  1. Reference
Fotor OpenAPI
  • Getting Started
    • Introduction
    • Access and Authentication
    • For Serverless Clients
    • Token Consumption
  • Reference
    • AI Upscaler
      POST
    • AI Skin Retouch
      POST
    • Text to Image
      POST
    • Image to Image (AI Art Effects)
      POST
    • Background Remover
      POST
    • AI Headshot
      POST
    • Photo Colorize
      POST
    • Photo Restoration
      POST
    • Face Swap
      POST
    • AI Replace
      POST
    • Query Task Details
      GET
  • Webhook
    • Webhook
  • AI Editor SDK
    • Getting Started
    • Get Sdk Temporary Token
      GET
  1. Reference

Query Task Details

GET
/v1/aiart/tasks/{taskId}
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.

Request

Path Params
taskId
string 
required
The taskId returned after submitting the task.
Header Params
Authorization
string 
required
Example:
Bearer <your api key>

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api-b.fotor.com/v1/aiart/tasks/' \
--header 'Authorization: Bearer <your api key>'

Responses

🟢200success
application/json
Body
code
string 
required
000: Success, 999: Unknown error
data
object 
required
taskId
string 
required
The unique identifier of the task.
createTime
integer 
required
updateTime
integer 
required
status
integer 
required
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
string 
required
The identifier of the business or project associated with this task.
type
string 
required
The type of the task being performed. For example:
videoEnhancer indicates a video enhancement operation.
avatar indicates an avatar generation operation.
resultUrl
string 
required
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
boolean 
required
Indicates whether harmful or sensitive content has been detected.
false means no sensitive content was detected.
true means sensitive content was detected.
avatarResult
array [object {2}] 
optional
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.
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
          }
        ]
      }
    ]
  }
}
Previous
AI Replace
Next
Webhook
Built with