Rotate Pages and Store

Purpose

This API allows you to rotate pages in a PDF and store the result in Zoho WorkDrive.

Quick Reference

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

Body Parameters

ParameterValueMandatory/OptionalDescription
fileFile or StringMandatoryUpload the PDF file from your local drive or desktop. If the PDF is available via a publicly accessible web URL, you can provide the URL using the same parameter.
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.
input_options{
  "page_ranges": "1,3-5",
  "direction": "right" | "left",
  "degree": 90 | 180 | 270 | 360
}
Optionalpage_ranges – Specify the pages to rotate. Accepts individual pages or ranges. Defaults to all pages if not provided.
direction – Specify the rotation direction. Possible values: right, left. Default: right.
degree – Specify the rotation angle. Possible values: 90, 180, 270, 360. Default: 90.

Notes and Limits

  • The maximum file size allowed for the input PDF is 50 MB. It cannot be more than 150 pages.
  • 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.files.ALL, WorkDrive.organization.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/rotate/store" \
  --header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
  --form 'file=@"/Users/username/Documents/Sample.pdf"' \
  --form 'output_settings=“{\”name\”:\”ModifiedFile.pdf\",\”folder_id\”:\” 1a2b3cefg\"}"' \
  --form 'input_options=“{\”page_ranges\”:\”1-4,8,10\",\”direction\”:\”right\",\”degree\”:\”90\"}"'

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/rotate/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"
}