pdfRest PDF to Office Pro Self-Hosted API Reference Guide
REST APIs supporting PDF to Microsoft Office document conversion capabilities through GET and POST HTTP requests


Getting Started
Welcome to the PDF to Office Pro Self-Hosted API Reference Guide! Below you will find all of the information you will need to use any of the PDF to Office Pro API Tools. This guide is organized by API endpoints, which express the output file types that can be generated from input files supplied with requests. For example, to convert PDF to Excel, you would send a PDF to the /excel endpoint.

Note that the examples throughout are presented using cURL, but the APIs support any standard method for sending GET and POST HTTP requests.

Additional Resources




API Endpoints
 GET  /resource/{id}

Summary

Retrieve a resource or its URL by ID. Resource IDs can be found in the JSON response of POST requests.

Examples
curl -X GET "YOUR_DOMAIN_HERE/resource/0950b9bdf-0465-4d3f-8ea3-d2894f1ae839?format=file" --output "@PATH_TO_FILE/output_file.pdf"
curl -X GET "YOUR_DOMAIN_HERE/resource/112f7ea0d-0e56-44bc-a3d2-42fdff96d993?format=url"


Path Parameters
NameDescriptionDefaultRequired
idAlphanumeric ID (UUID) of the resource to return

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneYes
formatSpecify whether to return the file directly, URL to the file, or information about the file

Accepts:
  • file - return the file itself
  • url - return JSON containing the URL of the resource file
  • info - return JSON containing detailed information about the file:
    • resource ID
    • file name
    • url
    • file type
    • file size (bytes)
    • last modified datetime
NoneYes


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "url": "YOUR_DOMAIN_HERE/resource/0950b9bdf-0465-4d3f-8ea3-d2894f1ae839?format=file"
}
200OK
(format = info)
{
   "id":"2e523af74-7de9-492a-b7c6-c96eacd18a3a",
   "name":"smallword.doc",
   "url":"YOUR_DOMAIN_HERE/resource/2e523af74-7de9-492a-b7c6-c96eacd18a3a?format=file",
   "type":"application/msword",
   "size":22528,
   "modified":"2023-05-19T16:22:56.780Z"
}
400Bad Request
{
   "error": "Invalid Request"
}
404Not Found
{
   "error": "That file does not exist"
}



 POST  /word

Summary
Converts a PDF to a Microsoft Word document
Examples
curl -X POST "YOUR_DOMAIN_HERE/word" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file"
curl -X POST "YOUR_DOMAIN_HERE/word" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"


Required Headers
Accept: application/json
Content-Type: multipart/form-data


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
[INPUT_FILE_NAME]_pdfrest_wordNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "YOUR_DOMAIN_HERE/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}



 POST  /excel

Summary
Converts a PDF to a Microsoft Excel document
Examples
curl -X POST "YOUR_DOMAIN_HERE/excel" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file"
curl -X POST "YOUR_DOMAIN_HERE/excel" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"


Required Headers
Accept: application/json
Content-Type: multipart/form-data


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
[INPUT_FILE_NAME]_pdfrest_excelNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "YOUR_DOMAIN_HERE/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}



 POST  /powerpoint

Summary
Converts a PDF to a Microsoft PowerPoint document
Examples
curl -X POST "YOUR_DOMAIN_HERE/powerpoint" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file"
curl -X POST "YOUR_DOMAIN_HERE/powerpoint" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"


Required Headers
Accept: application/json
Content-Type: multipart/form-data


Body Parameters
NameDescriptionDefaultRequired
fileFile to be uploaded and processed

Accepts:
Any PDF file

Example:
@PATH_TO_FILE/example_file.pdf
NoneOne of:
  • file
  • id
idAlphanumeric ID (UUID) of existing file on server to be processed

Accepts:
Any valid resource ID returned by a POST request

Example:
0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
NoneOne of:
  • file
  • id
outputName of the generated output file, without extension

Accepts:
Any valid file name

Example:
example_out
[INPUT_FILE_NAME]_pdfrest_powerpointNo


Responses
Response Status CodeDescriptionJSON Response Example
200OK
{
   "outputUrl": "YOUR_DOMAIN_HERE/resource/01240b25a-8936-4437-8652-8410130f1199?format=file"
"outputId": "01240b25a-8936-4437-8652-8410130f1199"
"inputId": "112f7ea0d-0e56-44bc-a3d2-42fdff96d993"
}
400Bad Request
{
   "error": "This route will only accept a File or an ID, not both."
}



© 2024 Datalogics, Inc. All rights reserved.