Image Background Generation Query API Reference

Image Background Generation Query

GET/POST /ai/image/background/generation/query

Using the taskID obtained from the Background Generation Submit API, you can call this API to query the results of the background-generated images.

Request Parameters

ParameterTypeRequiredDescriptionexplanation

taskId

String

Yes

The unique task ID. You can query the corresponding generation results using the task ID.

Unique task ID. Query the corresponding generation results based on the task ID.

Sample Request

IopClient client = new IopClient(url, appkey, appSecret);
IopRequest request = new IopRequest();
request.setApiName("/ai/image/background/generation/query");
request.addApiParameter("taskId", "7xxxxxxx-2xxx-4xxx-8xxx-8xxxxxxxxxxx");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

Response Parameters

ParameterTypeDescription

resCode

Number

The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list.

data

Object

The returned JSON result data.

taskMessage

String

The returned task information.

taskId

String

A unique task ID. It is used for subsequent result query requests.

taskStatus

String

Return the status of task execution.

taskResult

Object[]

Return the task results.

imageUrlList

Object[]

Return the list of URLs for the result images.

sceneTemplate

String

Return the scene template.

recordContent

String

Return the record content.

taskStatus

String

Return the task status.

taskMessage

String

Return the task message.

requestId

String

A unique request ID used for troubleshooting.

success

Boolean

The status of the returned request, indicating whether the request was successful.

resMessage

String

The returned request information.

Sample Response

{
  "data": {
    "taskResult": [
      {
        "imageUrlList": [
          "https://aibz-aigc-record.oss-ap-southeast-1.aliyuncs.com/pbg_result%2FMvRJHuDgDF%2FMvRJHuDgDF_3925947387.png?OSSAccessKeyId=LTAI5tAGoBnm5eYsnZ5E1zMr&Expires=4935975567&Signature=29Go0D26nksBs4K8JY0GJ4vHwUU%3D",
          "https://aibz-aigc-record.oss-ap-southeast-1.aliyuncs.com/pbg_result%2FMvRJHuDgDF%2FMvRJHuDgDF_3925947388.png?OSSAccessKeyId=LTAI5tAGoBnm5eYsnZ5E1zMr&Expires=4935975567&Signature=msIPWuZt1j8H0QVzVzZXbAk2VUM%3D"
        ],
        "taskStatus": "finished"
      }
    ],
    "taskId": "713f0cb3-f22f-490b-b3b7-3684f73bf2d6",
    "taskStatus": "finished"
  },
  "requestId": "210133e517193035913164122eaa87",
  "success": true,
  "resCode": 200,
  "resMessage": "success",
  "code": "0",
  "request_id": "2101725817193035913182132",
  "_trace_id_": "210133e517193035913164122eaa87"
}

Errors

Error CodeError MessageDescription

500

system error

System error.

501

rate limit exceed

The current interface has reached the current limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the current limit value.

700

invalid input

The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements.

801

model failed

Internal call exception, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting.

1000

content has sensitive data, please try other input

Content has sensitive data and cannot be handled now. Please try other input.

1001

content control failed, please retry

Content risk failed, please try other input. If an error persists,please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting.

1002

content risk filter failed, please contact us

Content risk failed, please contact us via navigation bar or email us (aidge_support@service.alibaba.com).

Last updated