To rotate pages PDF using our API Rest is necessary to perform a POST call to the following URL (ENDPOINT):
https://getoutpdf.com/api/tool/rotate-pdf
Our Rest API does not have operations via GET parameters
api_key
Api key generated for your license. You can see your api key pdf_in
Source PDF encoded in base64angle
Rotation angle. Rotation angle also depends of direction. If you set 90º and right direction it's the same that set 270º and left directiondirection
Direction of rotation. You can specify the direction of rotationpages
Pages to rotate. In this field you can set the pages to rotate (pages number separated by comma). If you set empty all pages will be rotates.application/x-www-form-urlencoded
, with the parameters described above.
Or you can send parameters via the JSON format, using the HTML Header application/json
:
{ "api_key" : "...", // string, required "pdf_in" : "...", // string, required "angle" : 90, // integer, optional, values: 0 | 90 | 180 | 270, default: 0 "direction" : "left", // string, optional, values: left | right, default: left "pages" : "1,3" // string, optional, default: "" (all pages rotated) }
{ "api_key" : "64b5d1054b69e676b9984d8406c5209a6ba78...", "pdf_in" : "JVBERi0xLjQNJeLjz9MNCjYgMCBvYmo8PC9I...", "angle" : 90, "direction" : "right", "pages" : "1,3,4,6" }
If the operation is successful the response is a JSON with the following structure:
{ "api_key": "...", // string - Api key used for your license "pdf_base64": "...", // string - PDF file encoded in base64 "tokens_used": "...", // integer - Tokens used in operation "tokens_left": "..." // integer - Tokens left }
If an error in sending parameters occurs, the response is a JSON with the following structure:
{ "errors": { "param1": [ // string - Parameter name that generated the error "message" // string - Error description ], "param2": [ "message" ], ... "paramN": [ "message" ] } }
If a operation error occurs, the answer will be a JSON with the following structure:
{ "errors": [ "message1", "message2", ... "messageN" ] }