The resources (image, video, voice) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.
POST https://openapi.akool.com/api/open/v3/content/image/bg/replace
Request Headers
Parameter
Value
Description
Authorization
Bearer {token}
Your API Key used for request authorization.Get Token
Body Attributes
Parameter
isRequired
Type
Value
Description
color_code
false
String
eg: #aafbe3
background color。 Use hexadecimal to represent colors
template_url
false
String
resource address of the background image
origin_img
true
String
Foreground image address
modify_template_size
false
String
eg:“3031x3372”
The size of the template image after expansion
modify_origin_img_size
true
String
eg: “3031x2894”
The size of the foreground image after scaling
overlay_origin_x
true
int
eg: 205
The position of the upper left corner of the foreground image in the canvas
overlay_origin_y
true
int
eg: 497
The position of the upper left corner of the foreground image in the canvas
overlay_template_x
false
int
eg: 10
The position of the upper left corner of the template image in the canvas
overlay_template_y
false
int
eg: 497
The position of the upper left corner of the template image in the canvas
canvas_size
true
String
eg:“3840x3840”
Canvas size
webhookUrl
true
String
Callback url address based on HTTP request
removeBg
false
Boolean
true or false default false
Whether to remove the background image
In addition to using the required parameters,you can also use one or both of the color_code or template_url parameters(but this is not required). Once you use template_url, you can carry three additional parameters: modify_template_size, overlay_template_x, and overlay_template_y.
Response Attributes
Parameter
Type
Value
Description
code
int
1000
Interface returns business status code(1000:success)
msg
String
Interface returns status information
data
Object
{ _id: "", image_status: 1 }
_id: Interface returns data, image_status: the status of image: 【1:queueing, 2:processing, 3:completed,4:failed】
ExampleBody
You have 4 combination parameters to choose from
The first combination of parameters: use template_url