Transitioning from the pdfRest Cloud API to the Self-Hosted API offers enhanced control and security for your document processing workflows. While both APIs share a common foundation, a few code adjustments are necessary for seamless migration. Follow this guide to make the switch efficiently.
Browsing both the Cloud API Reference Guide and the PDF Toolkit Self-Hosted API Reference Guide, you will notice that most of the API documentation is the same across both services, and the differences may be hard to spot. Let's step through those differences to highlight what you will need to modify from your Cloud API code to make it compatible with the Self-Hosted API.
You will need to update API calls to reflect Self-Hosted API endpoints. This involves substituting the domain component of the endpoint, https://api.pdfrest.com
, with the custom URL configured for your Self-Hosted API backend.
The endpoint route names for each tool remain the same. For example, /compressed-pdf
would be the same route name appended to the end of the Cloud API or your own Self-Hosted API domain, as in:
https://api.pdfrest.com/compressed-pdf
https://your-domain-example.com/compressed-pdf
Each API Call to the Cloud API service requires your API Key to be included as a header parameter. The Self-Hosted API service does not require API Keys, as this service provides you with full control to set and configure security measures within AWS. You can simply remove the API Key header parameter from all calls sent to Self-Hosted API.
Cloud API request example:
curl -X POST "https://api.pdfrest.com/compressed-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ -F "file=@/path/to/file" \ -F "output=example_out" \ -F "compression_level=high"
Self-Hosted API request example:
curl -X POST "YOUR_DOMAIN_HERE/compressed-pdf" \ -H "accept: application/json" \ -H "Content-Type: multipart/form-data" \ -F "file=@/path/to/file" \ -F "output=example_output" \ -F "compression_level=high"
Tools that are designated as Pro Tools in the Cloud API service can be accessed via separate Self-Hosted products in AWS and separate documentation pages. The same changes described above apply to these tools for converting Cloud API code to Self-Hosted API code.
PDF Forms Pro
PDF to Office Pro
By following these steps, you'll successfully adapt your code for the Self-Hosted API and enjoy the benefits of enhanced control and security over your document processing workflows. If you encounter any challenges, please reach out to the pdfRest support team for assistance.
Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.