size<=20MB, 64<= width or height <= 9216 (pixel)
1.Create Task
Name: createtask
Dependency: None
Request Parameters
{
picurl: "url", # String, image url, not support secondary jump
type: 1, # Int, see "Enhance Type"
chtaskid: "id" # String, Nullable, your private task id
}
Encrypt: None
Respone
{
code: 0, # status code, Int
msg: '', # message, String
data: {
taskid: "", # String, task id
status: 0, # Int, see "Task Status"
queuenum: 0 # Int, your task's position in the queue
}
}
Error Code
Error Code | Desc |
---|
1001001 | Create task failed |
1001002 | Validate picurl fail |
1001003 | Image too large |
1001004 | Unsupport file types |
1003002 | Insufficient balance |
2.Query Task
- Name: gettask
- Dependency: None
- Request Parameters
{
taskid: "", # String, task id
type: 1, # Int, see "Enhance Type"
}
{
code: 0, # status code, Int
msg: '', # message, String
data: {
taskid: "", # String
status: 0, # Int, see "Task status"
queuenum: 0, # Int, your task's position in the queue
errorcode: 0, # Int, error code
errormsg: "", # String, error message
inputurl: "", # String, input image url
inpathwidth: 1, # Int , input image width, pixel
inpathsize: 1, # Int, input image size
inpathheight: 1, # Int, input image height, pixel
inpathext: "jpg", # String, input image type
outpathwidth: 1, # Int , output image width, pixel
outpathsize: 1, # Int , output image size
outpathheight: 1, # Int , output image width, pixel
outpathext: "jpg", # String, output image type
outputurl: "", # String, output image url
facenum: 1, # face number, or output image number for "Colorize Black White Photo"
chtaskid: "", # your private task id
facelist: [
{
inputurl: "", # String, input image url
inpathwidth: 1, # Int , input image width, pixel
inpathsize: 1, # Int, input image size
inpathheight: 1, # Int, input image height, pixel
inpathext: "jpg", # String, input image type
outpathwidth: 1, # Int , output image width, pixel
outpathsize: 1, # Int , output image size
outpathheight: 1, # Int , output image width, pixel
outpathext: "jpg", # String, output image type
outputurl: "", # String, output image url
}
] # Array, face list or output image list for "Colorize Black White Photo"
}
}
Error Code | Desc |
---|
1002001 | Task not exist |
1002002 | Task was deleted |
3.Delete Task
- Name: deletetask
- Dependency: None
- Request Parameters
{
taskid: "", # String, the task id you want to delete
}
{
code: 0, # status code, Int
msg: '', # message, String
data: {
success: true, # Bool, the operation is successful or not
}
}
Error Code | Desc |
---|
1002001 | Task not exist |
1002002 | Task was deleted |
4. Callback Service
If you provide a valid callback url , the server will notify you result when enhance task is completed via this url. We will validate your url first and report the result.
Callback strategy: if the first try is succeful, the callback finished. And if the first try is fail, then the server will try up to 3 times. If all attempts fail, you shold prepare the solution to query the task by yourself.
Callback parameters
Header
{
"token": "", # String, your api token
"md5": "", # String, see "MD5 Calculation"
}
Body
{
code: 0, # status code, Int
msg: '', # message, String
data: {
taskid: "", # String
status: 0, # Int, see "Task Status"
queuenum: 0, # Int, your task's position in the queue
errorcode: 0, # Int, error code
errormsg: "", # String, error message
inputurl: "", # String, input image url
inpathwidth: 1, # Int , input image width, pixel
inpathsize: 1, # Int, input image size
inpathheight: 1, # Int, input image height, pixel
inpathext: "jpg", # String, input image type
outpathwidth: 1, # Int , output image width, pixel
outpathsize: 1, # Int , output image size
outpathheight: 1, # Int , output image width, pixel
outpathext: "jpg", # String, output image type
outputurl: "", # String, output image url
facenum: 1, # face number, or output image number for "Colorize Black White Photo"
chtaskid: "", # your private task id
facelist: [
{
inputurl: "", # String, input image url
inpathwidth: 1, # Int , input image width, pixel
inpathsize: 1, # Int, input image size
inpathheight: 1, # Int, input image height, pixel
inpathext: "jpg", # String, input image type
outpathwidth: 1, # Int , output image width, pixel
outpathsize: 1, # Int , output image size
outpathheight: 1, # Int , output image width, pixel
outpathext: "jpg", # String, output image type
outputurl: "", # String, output image url
}
] # Array, face list or output image list for "Colorize Black White Photo"
}
Error Code: Node
Dependency: None
Expect Your Response
{
code: 0, # status code, Int
msg: '', # message, String
data: {
success: true, # Bool, receive the callback or not
}
}