Skip to main content

Document Merge

💡 API calls require authentication. Refer to Interface Authentication for authentication

POST {apiPrefix}/merge

Submit document merge task

  • If task addition fails, the failure reason is returned synchronously
  • If task addition succeeds, the task ID is returned synchronously. Third parties can configure task callback notifications to get task status.

Request Body:

Content-Type is application/json

Parameter NameTypeDescriptionRequired
callbackstringCallback address. zOffice will callback to notify status after task completionYes
tokenTypestringThird-party token type, value is cookie or headerNo
tokenValuestringThird-party token value, passed back when zOffice downloads files or callback notificationsNo
fileListarrayList of files to merge (file information see table below, length between 1~10 (inclusive))Yes

File Information:

Parameter NameTypeDescriptionRequired
downloadUrlstringFile download linkYes
filenamestringFilename with extension (supports text (doc,docx,wps) and fixed layout (pdf), must be same type)Yes
startnumberStarting page number of document to merge (inclusive), starting from 1. Default 1. Must be greater than or equal to 1. Only pdf files supported.No
endnumberEnding page number of document to merge (inclusive), starting from 1. Default last page. Must be greater than or equal to 1. Only pdf files supported.No
  • For downloadUrl(same as fileUrl)/tokenType/tokenValue/callback description, see Common Field Description in this document
  • Fixed layout files single size cannot exceed 200m, total size cannot exceed 400m. Text files single size cannot exceed 200m, total size cannot exceed 300m.

Normal Response:

{
"taskId": "6f6598c8-c87e-420b-b6c4-6f1b187201dc",
"code": "Ok",
"detail": {
"taskStatus": "IN_QUEUE"
}
}

Error Response:

{
"taskId": "695fbf6e-90d2-42ba-83d5-00e81e5e366e",
"code": "TaskQueueCongestion",
"detail": {
"taskStatus": "FAIL"
}
}