Insert Pages and Store

Purpose

This API allows you to insert pages from a source PDF into an original PDF and store the result in Zoho WorkDrive.

Quick Reference

PropertyValue
MethodPOST
Request URLhttps://{zohoapis_domain}/pdfeditor/api/v1/pdf/pages/insert/store

Body Parameters

ParameterValueMandatory/OptionalDescription
original_fileFile or StringMandatoryUpload the PDF into which pages need to be inserted, from your local drive or desktop, or via a publicly accessible web URL.
source_fileFile or StringMandatoryUpload the PDF from which pages will be taken, from your local drive or desktop, or via a publicly accessible web URL.
input_options{
  "page_number": 3,
  "position": "before" | "after"
}
Mandatorypage_number – Specify the page number at which the source PDF should be inserted.
position – Specify the insertion position. Use before to insert before the specified page, or after to insert after it.
output_settings{
  "name": "<document_name>",
  "folder_id": "<folder_id>",
  "overwrite_existing_file": true | false
}
Mandatoryname – Specify the name for the output PDF document.
folder_id – Specify the ID of the WorkDrive folder in which to store the output file.
overwrite_existing_file(optional) – Set to true to overwrite an existing file with the same name in the folder.

Notes and Limits

  • The maximum file size allowed for each input PDF is 50 MB.
  • This API stores the result in Zoho WorkDrive. A WorkDrive account is required.
  • To use this API, an OAuth token should be generated with the following scopes: ZohoWriter.pdfEditor.ALL, WorkDrive.organization.ALL, WorkDrive.files.ALL

Possible Errors

Refer to the following pages for the list of possible errors for this API:

Sample Request

Copiedcurl --location --request POST "https://www.zohoapis.com/pdfeditor/api/v1/pdf/pages/insert/store" \
  --header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
  --form 'original_file=@"/Users/username/Documents/Existing.pdf"' \
  --form 'source_file=@"/Users/username/Documents/Source.pdf"' \
  --form 'input_options=“{\”page_number\”:\”3\",\”position\”:\”after\"}"' \
  --form 'output_settings=“{\”name\”:\”ModifiedFile.pdf\",\”folder_id\”:\”1a2b3cefg\"}"' 

Once the process begins, you will initially receive the 'status_url.' By invoking the 'status_url,' you will be able to monitor the status of the scheduled job.

Sample Response

Copied{
	"status_check_url" : "https://pdf.zoho.com/pdfeditor/api/v1/pdf/pages/insert/job/f931a01183b33",
	"document_url" : "https://workdrive.zoho.com/file/ponazfea04477109f4681a831e7177d96bc40",
	"document_id" : "ponazfea04477109f4681a831e7177d96bc40",
	"status" : "inprogress"
}

Success Response

Copied{
	 "document_url" : "https://workdrive.zoho.com/file/ponazfea04477109f4681a831e7177d96bc40",
	 "document_id" : "ponazfea04477109f4681a831e7177d96bc40",
         "status": "success"
}