# Photo Eraser-API Integration

Remove image watermark based on the image and a mask image indicating the restoration area.

# Task Creation

Create an algorithm task based on the input parameters and return the task id

# Request Address

/v3/pic/rw/batch

# Request Parameter

Method

post

Header

Field Required Type Value Description
Content-Type YES string application/json
Authorization YES string Basic xxxxxxxxx Basic base64 (appkey:appsecret) created by users combining appkey and secret

Body

Field Required Type Value Description
images YES string[] Up to 20 images awaiting processing (Downloadable image file link)
mask YES string Supporting formats such as Base64 and URI. Mark the mask image for the restoration area.
priority YES integer Priority, range [0,9]

Sample Code

{
  "images": [
    "Downloadable image file link",
    "Downloadable image file link"
  ],
  "mask": "Downloadable image file link",
  "priority": 1
}

# Input File Restriction

Image Format Image File Size Image Resolution Image Aspect Ratio
PNG JPG JPEG BMP No more than 50 MB Greater than 256x256px, less than 5000x5000px Aspect ratio within 4:1

# Return Data

Body

Field Son Field Required Type Value Description
code - YES number Status Code
msg - YES string Request Information
data - YES object Response Data
- task_id YES string Task id

Sample Code

{
  "code": 0,
  "msg": "",
  "data": {
    "task_id": "6a4eab77-be30-430a-bf0e-3048042a34ef"
  }
}

# Result Acquisition

Request task processing result based on task id

# Request Address

/v3/pic/rw/result/{task_id}

# Request Parameter

Method

get

Header

Field Required Type Value Description
Content-Type YES string application/json
Authorization YES string Basic xxxxxxxxx Basic base64 (appkey:appsecret) created by users combining appkey and secret

Path Parameter

Field Son Field Required Type Value Description
task_id - YES string Task id

# Return Data

Body

Field Son Field Grandson Field Required Type Value Description
code - - YES number Status Code
msg - - YES string Request Information
data - - YES object Response Data
- status - YES string Task Status: 1- Waiting; 2 - In progress; 3 - Task complete; 4 - Task failure; 5 - Task closed; 6 - Task timed out
- wait_time - YES string The waiting time before the next request, with unit of s
- list - YES object[] Result list
- - image_result YES string Processed image URL
- - status YES string Process Status
- - reason YES string Cause of failure
Last Updated: 12/1/2023, 5:45:54 PM