diff --git a/Java/Complex Flow Examples/DecryptAddReencrypt.java b/Java/Complex Flow Examples/DecryptAddReencrypt.java index 4028508b..ef7984a4 100644 --- a/Java/Complex Flow Examples/DecryptAddReencrypt.java +++ b/Java/Complex Flow Examples/DecryptAddReencrypt.java @@ -16,6 +16,14 @@ public class DecryptAddReencrypt { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your PDF file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -51,7 +59,7 @@ public static void main(String[] args) { Request decryptRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/decrypted-pdf") + .url(API_URL + "/decrypted-pdf") .post(decryptRequestBody) .build(); try { @@ -87,7 +95,7 @@ public static void main(String[] args) { Request addImageRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-image") + .url(API_URL + "/pdf-with-added-image") .post(addImageRequestBody) .build(); try { @@ -119,7 +127,7 @@ public static void main(String[] args) { Request encryptRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/encrypted-pdf") + .url(API_URL + "/encrypted-pdf") .post(encryptRequestBody) .build(); try { diff --git a/Java/Complex Flow Examples/MergeDifferentFileTypes.java b/Java/Complex Flow Examples/MergeDifferentFileTypes.java index f24ca667..4bd8f12c 100644 --- a/Java/Complex Flow Examples/MergeDifferentFileTypes.java +++ b/Java/Complex Flow Examples/MergeDifferentFileTypes.java @@ -19,6 +19,14 @@ public class MergeDifferentFileTypes { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your first file here, or as the first argument when running the program. private static final String DEFAULT_FIRST_FILE_PATH = "/path/to/file.png"; @@ -53,7 +61,7 @@ public static void main(String[] args) { Request firstFileRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf") + .url(API_URL + "/pdf") .post(firstFileRequestBody) .build(); try { @@ -85,7 +93,7 @@ public static void main(String[] args) { Request secondFileRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf") + .url(API_URL + "/pdf") .post(secondFileRequestBody) .build(); try { @@ -121,7 +129,7 @@ public static void main(String[] args) { Request mergeRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/merged-pdf") + .url(API_URL + "/merged-pdf") .post(mergeRequestBody) .build(); try { diff --git a/Java/Complex Flow Examples/OcrWithExtractText.java b/Java/Complex Flow Examples/OcrWithExtractText.java index dbacd17c..b97abd73 100644 --- a/Java/Complex Flow Examples/OcrWithExtractText.java +++ b/Java/Complex Flow Examples/OcrWithExtractText.java @@ -16,6 +16,14 @@ public class OcrWithExtractText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your PDF file here, or as the first argument when running the program. private static final String DEFAULT_PDF_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request ocrRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-ocr-text") + .url(API_URL + "/pdf-with-ocr-text") .post(ocrRequestBody) .build(); try { @@ -74,7 +82,7 @@ public static void main(String[] args) { Request extractRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/extracted-text") + .url(API_URL + "/extracted-text") .post(extractRequestBody) .build(); try { diff --git a/Java/Complex Flow Examples/PDFA3bWithAttachment.java b/Java/Complex Flow Examples/PDFA3bWithAttachment.java index c93544ac..38dd135b 100644 --- a/Java/Complex Flow Examples/PDFA3bWithAttachment.java +++ b/Java/Complex Flow Examples/PDFA3bWithAttachment.java @@ -17,6 +17,14 @@ public class PDFA3bWithAttachment { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -54,7 +62,7 @@ public static void main(String[] args) { Request attachmentRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-attachment") + .url(API_URL + "/pdf-with-added-attachment") .post(attachmentRequestBody) .build(); try { @@ -85,7 +93,7 @@ public static void main(String[] args) { Request pdfaRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdfa") + .url(API_URL + "/pdfa") .post(pdfaRequestBody) .build(); try { diff --git a/Java/Complex Flow Examples/PreserveWordDocument.java b/Java/Complex Flow Examples/PreserveWordDocument.java index 7304c4e2..e22734b7 100644 --- a/Java/Complex Flow Examples/PreserveWordDocument.java +++ b/Java/Complex Flow Examples/PreserveWordDocument.java @@ -14,6 +14,14 @@ public class PreserveWordDocument { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -42,7 +50,7 @@ public static void main(String[] args) { Request pdfRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf") + .url(API_URL + "/pdf") .post(pdfRequestBody) .build(); try { @@ -73,7 +81,7 @@ public static void main(String[] args) { Request pdfaRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdfa") + .url(API_URL + "/pdfa") .post(pdfaRequestBody) .build(); try { diff --git a/Java/Complex Flow Examples/ProtectedWatermark.java b/Java/Complex Flow Examples/ProtectedWatermark.java index 40805729..54d1d6aa 100644 --- a/Java/Complex Flow Examples/ProtectedWatermark.java +++ b/Java/Complex Flow Examples/ProtectedWatermark.java @@ -14,6 +14,14 @@ public class ProtectedWatermark { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -43,7 +51,7 @@ public static void main(String[] args) { Request watermarkRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/watermarked-pdf") + .url(API_URL + "/watermarked-pdf") .post(watermarkRequestBody) .build(); try { @@ -77,7 +85,7 @@ public static void main(String[] args) { Request restrictRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/restricted-pdf") + .url(API_URL + "/restricted-pdf") .post(restrictRequestBody) .build(); try { diff --git a/Java/Complex Flow Examples/RedactPreviewAndFinalize.java b/Java/Complex Flow Examples/RedactPreviewAndFinalize.java index 1b134a6f..56159a8e 100644 --- a/Java/Complex Flow Examples/RedactPreviewAndFinalize.java +++ b/Java/Complex Flow Examples/RedactPreviewAndFinalize.java @@ -15,6 +15,14 @@ public class RedactPreviewAndFinalize { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -47,7 +55,7 @@ public static void main(String[] args) { Request previewRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-redacted-text-preview") + .url(API_URL + "/pdf-with-redacted-text-preview") .post(previewRequestBody) .build(); try { @@ -77,7 +85,7 @@ public static void main(String[] args) { Request appliedRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-redacted-text-applied") + .url(API_URL + "/pdf-with-redacted-text-applied") .post(appliedRequestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/BatchDelete.java b/Java/Endpoint Examples/JSON Payload/BatchDelete.java index ad804fbc..9484adac 100644 --- a/Java/Endpoint Examples/JSON Payload/BatchDelete.java +++ b/Java/Endpoint Examples/JSON Payload/BatchDelete.java @@ -6,6 +6,14 @@ public class BatchDelete { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static String API_URL = "https://eu-api.pdfrest.com" + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -23,7 +31,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Bmp.java b/Java/Endpoint Examples/JSON Payload/Bmp.java index 9647697a..88e18aa1 100644 --- a/Java/Endpoint Examples/JSON Payload/Bmp.java +++ b/Java/Endpoint Examples/JSON Payload/Bmp.java @@ -8,6 +8,14 @@ public class Bmp { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/bmp") + .url(API_URL + "/bmp") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/CompressedPDF.java b/Java/Endpoint Examples/JSON Payload/CompressedPDF.java index e238824e..90ae6e2b 100644 --- a/Java/Endpoint Examples/JSON Payload/CompressedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/CompressedPDF.java @@ -8,6 +8,14 @@ public class CompressedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -45,7 +53,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/compressed-pdf") + .url(API_URL + "/compressed-pdf") .post(requestBody) .build(); try { @@ -79,7 +87,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/DecryptedPDF.java b/Java/Endpoint Examples/JSON Payload/DecryptedPDF.java index 24a30b2d..52faceef 100644 --- a/Java/Endpoint Examples/JSON Payload/DecryptedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/DecryptedPDF.java @@ -8,6 +8,14 @@ public class DecryptedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/decrypted-pdf") + .url(API_URL + "/decrypted-pdf") .post(requestBody) .build(); try { @@ -76,7 +84,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -114,7 +122,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/DeleteResource.java b/Java/Endpoint Examples/JSON Payload/DeleteResource.java index 6459a2c4..95c5b143 100644 --- a/Java/Endpoint Examples/JSON Payload/DeleteResource.java +++ b/Java/Endpoint Examples/JSON Payload/DeleteResource.java @@ -5,6 +5,14 @@ public class DeleteResource { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Resource UUIDs can be found in the JSON response of POST requests as "outputId". // Resource UUIDs usually look like this: '0950b9bdf-0465-4d3f-8ea3-d2894f1ae839'. private static final String FILE_ID = @@ -22,7 +30,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/resource/" + FILE_ID) + .url(API_URL + "/resource/" + FILE_ID) .method("DELETE", requestBody) .build(); Response response = client.newCall(request).execute(); diff --git a/Java/Endpoint Examples/JSON Payload/EncryptedPDF.java b/Java/Endpoint Examples/JSON Payload/EncryptedPDF.java index c818cd92..9ec439d4 100644 --- a/Java/Endpoint Examples/JSON Payload/EncryptedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/EncryptedPDF.java @@ -8,6 +8,14 @@ public class EncryptedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/encrypted-pdf") + .url(API_URL + "/encrypted-pdf") .post(requestBody) .build(); try { @@ -75,7 +83,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -112,7 +120,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Excel.java b/Java/Endpoint Examples/JSON Payload/Excel.java index 67e88314..359fdd4b 100644 --- a/Java/Endpoint Examples/JSON Payload/Excel.java +++ b/Java/Endpoint Examples/JSON Payload/Excel.java @@ -8,6 +8,14 @@ public class Excel { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/excel") + .url(API_URL + "/excel") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/ExportedFormData.java b/Java/Endpoint Examples/JSON Payload/ExportedFormData.java index 8b817665..5d296a98 100644 --- a/Java/Endpoint Examples/JSON Payload/ExportedFormData.java +++ b/Java/Endpoint Examples/JSON Payload/ExportedFormData.java @@ -8,6 +8,14 @@ public class ExportedFormData { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/exported-form-data") + .url(API_URL + "/exported-form-data") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/ExtractedImages.java b/Java/Endpoint Examples/JSON Payload/ExtractedImages.java index 1ec93c17..95d31a37 100644 --- a/Java/Endpoint Examples/JSON Payload/ExtractedImages.java +++ b/Java/Endpoint Examples/JSON Payload/ExtractedImages.java @@ -8,6 +8,14 @@ public class ExtractedImages { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/extracted-images") + .url(API_URL + "/extracted-images") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/ExtractedText.java b/Java/Endpoint Examples/JSON Payload/ExtractedText.java index f0e4a0f4..d06b0a1d 100644 --- a/Java/Endpoint Examples/JSON Payload/ExtractedText.java +++ b/Java/Endpoint Examples/JSON Payload/ExtractedText.java @@ -8,6 +8,14 @@ public class ExtractedText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/extracted-text") + .url(API_URL + "/extracted-text") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/FlattenedAnnotationsPDF.java b/Java/Endpoint Examples/JSON Payload/FlattenedAnnotationsPDF.java index 609c9e09..4e7f0b1d 100644 --- a/Java/Endpoint Examples/JSON Payload/FlattenedAnnotationsPDF.java +++ b/Java/Endpoint Examples/JSON Payload/FlattenedAnnotationsPDF.java @@ -8,6 +8,14 @@ public class FlattenedAnnotationsPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-annotations-pdf") + .url(API_URL + "/flattened-annotations-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/FlattenedFormsPDF.java b/Java/Endpoint Examples/JSON Payload/FlattenedFormsPDF.java index b39c1ce3..68bcaf12 100644 --- a/Java/Endpoint Examples/JSON Payload/FlattenedFormsPDF.java +++ b/Java/Endpoint Examples/JSON Payload/FlattenedFormsPDF.java @@ -8,6 +8,14 @@ public class FlattenedFormsPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-forms-pdf") + .url(API_URL + "/flattened-forms-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/FlattenedLayersPDF.java b/Java/Endpoint Examples/JSON Payload/FlattenedLayersPDF.java index bc8c371a..870e5294 100644 --- a/Java/Endpoint Examples/JSON Payload/FlattenedLayersPDF.java +++ b/Java/Endpoint Examples/JSON Payload/FlattenedLayersPDF.java @@ -8,6 +8,14 @@ public class FlattenedLayersPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-layers-pdf") + .url(API_URL + "/flattened-layers-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/FlattenedTransparenciesPDF.java b/Java/Endpoint Examples/JSON Payload/FlattenedTransparenciesPDF.java index a62eb496..54828a63 100644 --- a/Java/Endpoint Examples/JSON Payload/FlattenedTransparenciesPDF.java +++ b/Java/Endpoint Examples/JSON Payload/FlattenedTransparenciesPDF.java @@ -8,6 +8,14 @@ public class FlattenedTransparenciesPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-transparencies-pdf") + .url(API_URL + "/flattened-transparencies-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/GetResource.java b/Java/Endpoint Examples/JSON Payload/GetResource.java index 769213f0..c80b7e89 100644 --- a/Java/Endpoint Examples/JSON Payload/GetResource.java +++ b/Java/Endpoint Examples/JSON Payload/GetResource.java @@ -7,6 +7,14 @@ public class GetResource { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Resource UUIDs can be found in the JSON response of POST requests as "outputId". // Resource UUIDs usually look like this: '0950b9bdf-0465-4d3f-8ea3-d2894f1ae839'. private static final String FILE_ID = @@ -19,8 +27,7 @@ public class GetResource { public static void main(String[] args) { try { - String urlString = - String.format("https://api.pdfrest.com/resource/%s?format=%2s", FILE_ID, OUTPUT_FORMAT); + String urlString = String.format(API_URL + "/resource/%s?format=%2s", FILE_ID, OUTPUT_FORMAT); InputStream in = new URL(urlString).openStream(); Files.copy(in, Paths.get("/path/to/write/file")); // Set a path for the file to be written } catch (IOException e) { diff --git a/Java/Endpoint Examples/JSON Payload/Gif.java b/Java/Endpoint Examples/JSON Payload/Gif.java index eee808c4..c0884210 100644 --- a/Java/Endpoint Examples/JSON Payload/Gif.java +++ b/Java/Endpoint Examples/JSON Payload/Gif.java @@ -8,6 +8,14 @@ public class Gif { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/gif") + .url(API_URL + "/gif") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Jpg.java b/Java/Endpoint Examples/JSON Payload/Jpg.java index 215c9706..e751884b 100644 --- a/Java/Endpoint Examples/JSON Payload/Jpg.java +++ b/Java/Endpoint Examples/JSON Payload/Jpg.java @@ -8,6 +8,14 @@ public class Jpg { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/jpg") + .url(API_URL + "/jpg") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/LinearizedPDF.java b/Java/Endpoint Examples/JSON Payload/LinearizedPDF.java index 9c62546c..84c1f705 100644 --- a/Java/Endpoint Examples/JSON Payload/LinearizedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/LinearizedPDF.java @@ -8,6 +8,14 @@ public class LinearizedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/linearized-pdf") + .url(API_URL + "/linearized-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Markdown.java b/Java/Endpoint Examples/JSON Payload/Markdown.java index f95a3aff..a0d0a71e 100644 --- a/Java/Endpoint Examples/JSON Payload/Markdown.java +++ b/Java/Endpoint Examples/JSON Payload/Markdown.java @@ -8,6 +8,14 @@ public class Markdown { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -42,7 +50,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/markdown") + .url(API_URL + "/markdown") .post(requestBody) .build(); try { @@ -74,7 +82,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/MergedPDF.java b/Java/Endpoint Examples/JSON Payload/MergedPDF.java index fdc86c3b..f98308af 100644 --- a/Java/Endpoint Examples/JSON Payload/MergedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/MergedPDF.java @@ -8,6 +8,14 @@ public class MergedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + private static final String[] DEFAULT_FILE_PATHS = new String[] {"/path/to/file1.pdf", "/path/to/file2.pdf"}; @@ -58,7 +66,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/merged-pdf") + .url(API_URL + "/merged-pdf") .post(requestBody) .build(); try { @@ -92,7 +100,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDF.java b/Java/Endpoint Examples/JSON Payload/PDF.java index 34556d22..1fe414cb 100644 --- a/Java/Endpoint Examples/JSON Payload/PDF.java +++ b/Java/Endpoint Examples/JSON Payload/PDF.java @@ -8,6 +8,14 @@ public class PDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.png"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf") + .url(API_URL + "/pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.png") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFA.java b/Java/Endpoint Examples/JSON Payload/PDFA.java index 1072d91a..6f594942 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFA.java +++ b/Java/Endpoint Examples/JSON Payload/PDFA.java @@ -8,6 +8,14 @@ public class PDFA { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdfa") + .url(API_URL + "/pdfa") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFInfo.java b/Java/Endpoint Examples/JSON Payload/PDFInfo.java index 659b1a79..e3d19592 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFInfo.java +++ b/Java/Endpoint Examples/JSON Payload/PDFInfo.java @@ -8,6 +8,14 @@ public class PDFInfo { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-info") + .url(API_URL + "/pdf-info") .post(requestBody) .build(); try { @@ -80,7 +88,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithAcroforms.java b/Java/Endpoint Examples/JSON Payload/PDFWithAcroforms.java index 730bf0c9..b7fefd81 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithAcroforms.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithAcroforms.java @@ -8,6 +8,14 @@ public class PDFWithAcroforms { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-acroforms") + .url(API_URL + "/pdf-with-acroforms") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithAddedAttachment.java b/Java/Endpoint Examples/JSON Payload/PDFWithAddedAttachment.java index 3d173aed..60297668 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithAddedAttachment.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithAddedAttachment.java @@ -8,6 +8,14 @@ public class PDFWithAddedAttachment { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -61,7 +69,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-attachment") + .url(API_URL + "/pdf-with-added-attachment") .post(requestBody) .build(); try { @@ -95,7 +103,7 @@ private static String uploadFile(File inputFile, String filename) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", filename) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithAddedImage.java b/Java/Endpoint Examples/JSON Payload/PDFWithAddedImage.java index cb59ddc9..285144e2 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithAddedImage.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithAddedImage.java @@ -8,6 +8,14 @@ public class PDFWithAddedImage { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -62,7 +70,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-image") + .url(API_URL + "/pdf-with-added-image") .post(requestBody) .build(); try { @@ -96,7 +104,7 @@ private static String uploadFile(File inputFile, String filename) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", filename) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithAddedText.java b/Java/Endpoint Examples/JSON Payload/PDFWithAddedText.java index 8627ee46..98e794b7 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithAddedText.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithAddedText.java @@ -8,6 +8,14 @@ public class PDFWithAddedText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -48,7 +56,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-text") + .url(API_URL + "/pdf-with-added-text") .post(requestBody) .build(); try { @@ -82,7 +90,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithConvertedColors.java b/Java/Endpoint Examples/JSON Payload/PDFWithConvertedColors.java index dea53c56..d22884e3 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithConvertedColors.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithConvertedColors.java @@ -8,6 +8,14 @@ public class PDFWithConvertedColors { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-converted-colors") + .url(API_URL + "/pdf-with-converted-colors") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithImportedFormData.java b/Java/Endpoint Examples/JSON Payload/PDFWithImportedFormData.java index 07826057..65002a99 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithImportedFormData.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithImportedFormData.java @@ -8,6 +8,14 @@ public class PDFWithImportedFormData { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -60,7 +68,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-imported-form-data") + .url(API_URL + "/pdf-with-imported-form-data") .post(requestBody) .build(); try { @@ -94,7 +102,7 @@ private static String uploadFile(File inputFile, String filename) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", filename) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithOCRText.java b/Java/Endpoint Examples/JSON Payload/PDFWithOCRText.java index aa086363..8e6ec50b 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithOCRText.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithOCRText.java @@ -8,6 +8,14 @@ public class PDFWithOCRText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-ocr-text") + .url(API_URL + "/pdf-with-ocr-text") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithPageBoxesSet.java b/Java/Endpoint Examples/JSON Payload/PDFWithPageBoxesSet.java index e69ef410..53eaac57 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithPageBoxesSet.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithPageBoxesSet.java @@ -8,6 +8,14 @@ public class PDFWithPageBoxesSet { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -67,7 +75,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-page-boxes-set") + .url(API_URL + "/pdf-with-page-boxes-set") .post(requestBody) .build(); try { @@ -101,7 +109,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextApplied.java b/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextApplied.java index 7ef2955c..d41fc740 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextApplied.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextApplied.java @@ -8,6 +8,14 @@ public class PDFWithRedactedTextApplied { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -45,7 +53,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-redacted-text-applied") + .url(API_URL + "/pdf-with-redacted-text-applied") .post(requestBody) .build(); try { @@ -74,7 +82,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -111,7 +119,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextPreview.java b/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextPreview.java index 934250f4..c285437f 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextPreview.java +++ b/Java/Endpoint Examples/JSON Payload/PDFWithRedactedTextPreview.java @@ -8,6 +8,14 @@ public class PDFWithRedactedTextPreview { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -49,7 +57,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-redacted-text-preview") + .url(API_URL + "/pdf-with-redacted-text-preview") .post(requestBody) .build(); try { @@ -82,7 +90,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -120,7 +128,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/PDFX.java b/Java/Endpoint Examples/JSON Payload/PDFX.java index af0814f9..b8a78265 100644 --- a/Java/Endpoint Examples/JSON Payload/PDFX.java +++ b/Java/Endpoint Examples/JSON Payload/PDFX.java @@ -8,6 +8,14 @@ public class PDFX { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdfx") + .url(API_URL + "/pdfx") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Png.java b/Java/Endpoint Examples/JSON Payload/Png.java index e05cae8f..e5b22cd9 100644 --- a/Java/Endpoint Examples/JSON Payload/Png.java +++ b/Java/Endpoint Examples/JSON Payload/Png.java @@ -8,6 +8,14 @@ public class Png { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/png") + .url(API_URL + "/png") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Powerpoint.java b/Java/Endpoint Examples/JSON Payload/Powerpoint.java index 6ea26ad3..8f7f0a9b 100644 --- a/Java/Endpoint Examples/JSON Payload/Powerpoint.java +++ b/Java/Endpoint Examples/JSON Payload/Powerpoint.java @@ -8,6 +8,14 @@ public class Powerpoint { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/powerpoint") + .url(API_URL + "/powerpoint") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/RasterizedPDF.java b/Java/Endpoint Examples/JSON Payload/RasterizedPDF.java index 2dfd4db5..b9316d76 100644 --- a/Java/Endpoint Examples/JSON Payload/RasterizedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/RasterizedPDF.java @@ -8,6 +8,14 @@ public class RasterizedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/rasterized-pdf") + .url(API_URL + "/rasterized-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/RestrictedPDF.java b/Java/Endpoint Examples/JSON Payload/RestrictedPDF.java index 149b6ef1..182df6ec 100644 --- a/Java/Endpoint Examples/JSON Payload/RestrictedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/RestrictedPDF.java @@ -8,6 +8,14 @@ public class RestrictedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -48,7 +56,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/restricted-pdf") + .url(API_URL + "/restricted-pdf") .post(requestBody) .build(); try { @@ -77,7 +85,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -114,7 +122,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/SignedPDF.java b/Java/Endpoint Examples/JSON Payload/SignedPDF.java index 2e4cff72..56923714 100644 --- a/Java/Endpoint Examples/JSON Payload/SignedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/SignedPDF.java @@ -8,6 +8,14 @@ public class SignedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -73,7 +81,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/signed-pdf") + .url(API_URL + "/signed-pdf") .post(requestBody) .build(); try { @@ -106,7 +114,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", inputFile.getName()) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/SignedPDFNonPFX.java b/Java/Endpoint Examples/JSON Payload/SignedPDFNonPFX.java index aeb2da51..34d57e4a 100644 --- a/Java/Endpoint Examples/JSON Payload/SignedPDFNonPFX.java +++ b/Java/Endpoint Examples/JSON Payload/SignedPDFNonPFX.java @@ -8,6 +8,14 @@ public class SignedPDFNonPFX { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -63,7 +71,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/signed-pdf") + .url(API_URL + "/signed-pdf") .post(requestBody) .build(); try { @@ -96,7 +104,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", inputFile.getName()) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/SplitPDF.java b/Java/Endpoint Examples/JSON Payload/SplitPDF.java index 463de06a..bd50c2d7 100644 --- a/Java/Endpoint Examples/JSON Payload/SplitPDF.java +++ b/Java/Endpoint Examples/JSON Payload/SplitPDF.java @@ -8,6 +8,14 @@ public class SplitPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/split-pdf") + .url(API_URL + "/split-pdf") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Tif.java b/Java/Endpoint Examples/JSON Payload/Tif.java index 24c39afe..33f8e3db 100644 --- a/Java/Endpoint Examples/JSON Payload/Tif.java +++ b/Java/Endpoint Examples/JSON Payload/Tif.java @@ -8,6 +8,14 @@ public class Tif { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/tif") + .url(API_URL + "/tif") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/UnrestrictedPDF.java b/Java/Endpoint Examples/JSON Payload/UnrestrictedPDF.java index 88f74cf6..00afa3ca 100644 --- a/Java/Endpoint Examples/JSON Payload/UnrestrictedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/UnrestrictedPDF.java @@ -8,6 +8,14 @@ public class UnrestrictedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/unrestricted-pdf") + .url(API_URL + "/unrestricted-pdf") .post(requestBody) .build(); try { @@ -76,7 +84,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -114,7 +122,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Unzip.java b/Java/Endpoint Examples/JSON Payload/Unzip.java index d81b0395..21a7ceec 100644 --- a/Java/Endpoint Examples/JSON Payload/Unzip.java +++ b/Java/Endpoint Examples/JSON Payload/Unzip.java @@ -8,6 +8,14 @@ public class Unzip { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.zip"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/unzip") + .url(API_URL + "/unzip") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.zip") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/UpToolkit.java b/Java/Endpoint Examples/JSON Payload/UpToolkit.java index 561cb4bd..13b24d29 100644 --- a/Java/Endpoint Examples/JSON Payload/UpToolkit.java +++ b/Java/Endpoint Examples/JSON Payload/UpToolkit.java @@ -7,9 +7,17 @@ public class UpToolkit { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + public static void main(String[] args) { // up-forms and up-office can be used to query the other tools - Request request = new Request.Builder().url("https://api.pdfrest.com/up-toolkit").get().build(); + Request request = new Request.Builder().url(API_URL + "/up-toolkit").get().build(); try { OkHttpClient client = new OkHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); diff --git a/Java/Endpoint Examples/JSON Payload/Upload.java b/Java/Endpoint Examples/JSON Payload/Upload.java index 10f2e8af..3f807245 100644 --- a/Java/Endpoint Examples/JSON Payload/Upload.java +++ b/Java/Endpoint Examples/JSON Payload/Upload.java @@ -6,6 +6,14 @@ public class Upload { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -30,7 +38,7 @@ public static void main(String[] args) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/WatermarkedPDF.java b/Java/Endpoint Examples/JSON Payload/WatermarkedPDF.java index 230fed0c..7a63633a 100644 --- a/Java/Endpoint Examples/JSON Payload/WatermarkedPDF.java +++ b/Java/Endpoint Examples/JSON Payload/WatermarkedPDF.java @@ -8,6 +8,14 @@ public class WatermarkedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/watermarked-pdf") + .url(API_URL + "/watermarked-pdf") .post(requestBody) .build(); try { @@ -75,7 +83,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = @@ -112,7 +120,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Word.java b/Java/Endpoint Examples/JSON Payload/Word.java index 8c3a8630..f6544d3d 100644 --- a/Java/Endpoint Examples/JSON Payload/Word.java +++ b/Java/Endpoint Examples/JSON Payload/Word.java @@ -8,6 +8,14 @@ public class Word { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -44,7 +52,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/word") + .url(API_URL + "/word") .post(requestBody) .build(); try { @@ -78,7 +86,7 @@ private static String uploadFile(File inputFile) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", "File.pdf") - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/JSON Payload/Zip.java b/Java/Endpoint Examples/JSON Payload/Zip.java index a982cd6c..409eb807 100644 --- a/Java/Endpoint Examples/JSON Payload/Zip.java +++ b/Java/Endpoint Examples/JSON Payload/Zip.java @@ -8,6 +8,14 @@ public class Zip { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + private static final String[] DEFAULT_FILE_PATHS = new String[] {"/path/to/file1.pdf", "/path/to/file2.pdf"}; @@ -52,7 +60,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/zip") + .url(API_URL + "/zip") .post(requestBody) .build(); try { @@ -86,7 +94,7 @@ private static String uploadFile(File inputFile, String filename) { new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) .header("Content-Filename", filename) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/BatchDelete.java b/Java/Endpoint Examples/Multipart Payload/BatchDelete.java index 302b0c87..7dda6568 100644 --- a/Java/Endpoint Examples/Multipart Payload/BatchDelete.java +++ b/Java/Endpoint Examples/Multipart Payload/BatchDelete.java @@ -6,6 +6,14 @@ public class BatchDelete { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -23,7 +31,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Bmp.java b/Java/Endpoint Examples/Multipart Payload/Bmp.java index ebe93a15..b30b49fb 100644 --- a/Java/Endpoint Examples/Multipart Payload/Bmp.java +++ b/Java/Endpoint Examples/Multipart Payload/Bmp.java @@ -7,6 +7,14 @@ public class Bmp { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/bmp") + .url(API_URL + "/bmp") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/CompressedPDF.java b/Java/Endpoint Examples/Multipart Payload/CompressedPDF.java index 6dbfe535..108a7143 100644 --- a/Java/Endpoint Examples/Multipart Payload/CompressedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/CompressedPDF.java @@ -12,6 +12,14 @@ public class CompressedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -43,7 +51,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/compressed-pdf") + .url(API_URL + "/compressed-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/DecryptedPDF.java b/Java/Endpoint Examples/Multipart Payload/DecryptedPDF.java index 7171985e..2d08b594 100644 --- a/Java/Endpoint Examples/Multipart Payload/DecryptedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/DecryptedPDF.java @@ -7,6 +7,14 @@ public class DecryptedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -36,7 +44,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/decrypted-pdf") + .url(API_URL + "/decrypted-pdf") .post(requestBody) .build(); try { @@ -66,7 +74,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/DeleteResource.java b/Java/Endpoint Examples/Multipart Payload/DeleteResource.java index 6459a2c4..95c5b143 100644 --- a/Java/Endpoint Examples/Multipart Payload/DeleteResource.java +++ b/Java/Endpoint Examples/Multipart Payload/DeleteResource.java @@ -5,6 +5,14 @@ public class DeleteResource { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Resource UUIDs can be found in the JSON response of POST requests as "outputId". // Resource UUIDs usually look like this: '0950b9bdf-0465-4d3f-8ea3-d2894f1ae839'. private static final String FILE_ID = @@ -22,7 +30,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/resource/" + FILE_ID) + .url(API_URL + "/resource/" + FILE_ID) .method("DELETE", requestBody) .build(); Response response = client.newCall(request).execute(); diff --git a/Java/Endpoint Examples/Multipart Payload/EncryptedPDF.java b/Java/Endpoint Examples/Multipart Payload/EncryptedPDF.java index 62306bf2..90caa42b 100644 --- a/Java/Endpoint Examples/Multipart Payload/EncryptedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/EncryptedPDF.java @@ -7,6 +7,14 @@ public class EncryptedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -36,7 +44,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/encrypted-pdf") + .url(API_URL + "/encrypted-pdf") .post(requestBody) .build(); try { @@ -66,7 +74,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/Excel.java b/Java/Endpoint Examples/Multipart Payload/Excel.java index fbd211f7..182bf6ca 100644 --- a/Java/Endpoint Examples/Multipart Payload/Excel.java +++ b/Java/Endpoint Examples/Multipart Payload/Excel.java @@ -12,6 +12,14 @@ public class Excel { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -40,7 +48,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/excel") + .url(API_URL + "/excel") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/ExportedFormData.java b/Java/Endpoint Examples/Multipart Payload/ExportedFormData.java index 08a4281e..c5df0077 100644 --- a/Java/Endpoint Examples/Multipart Payload/ExportedFormData.java +++ b/Java/Endpoint Examples/Multipart Payload/ExportedFormData.java @@ -7,6 +7,14 @@ public class ExportedFormData { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/exported-form-data") + .url(API_URL + "/exported-form-data") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/ExtractedImages.java b/Java/Endpoint Examples/Multipart Payload/ExtractedImages.java index 17ff354e..7d92b163 100644 --- a/Java/Endpoint Examples/Multipart Payload/ExtractedImages.java +++ b/Java/Endpoint Examples/Multipart Payload/ExtractedImages.java @@ -12,6 +12,14 @@ public class ExtractedImages { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -43,7 +51,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/extracted-images") + .url(API_URL + "/extracted-images") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/ExtractedText.java b/Java/Endpoint Examples/Multipart Payload/ExtractedText.java index 159b031b..95a7448f 100644 --- a/Java/Endpoint Examples/Multipart Payload/ExtractedText.java +++ b/Java/Endpoint Examples/Multipart Payload/ExtractedText.java @@ -11,6 +11,14 @@ public class ExtractedText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -38,7 +46,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/extracted-text") + .url(API_URL + "/extracted-text") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/FlattenedAnnotationsPDF.java b/Java/Endpoint Examples/Multipart Payload/FlattenedAnnotationsPDF.java index 01be0b04..86875711 100644 --- a/Java/Endpoint Examples/Multipart Payload/FlattenedAnnotationsPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/FlattenedAnnotationsPDF.java @@ -7,6 +7,14 @@ public class FlattenedAnnotationsPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-annotations-pdf") + .url(API_URL + "/flattened-annotations-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/FlattenedFormsPDF.java b/Java/Endpoint Examples/Multipart Payload/FlattenedFormsPDF.java index d3b9c6d9..35c478f9 100644 --- a/Java/Endpoint Examples/Multipart Payload/FlattenedFormsPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/FlattenedFormsPDF.java @@ -7,6 +7,14 @@ public class FlattenedFormsPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-forms-pdf") + .url(API_URL + "/flattened-forms-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/FlattenedLayersPDF.java b/Java/Endpoint Examples/Multipart Payload/FlattenedLayersPDF.java index 8c9feebe..a88bc8b0 100644 --- a/Java/Endpoint Examples/Multipart Payload/FlattenedLayersPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/FlattenedLayersPDF.java @@ -7,6 +7,14 @@ public class FlattenedLayersPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-layers-pdf") + .url(API_URL + "/flattened-layers-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/FlattenedTransparenciesPDF.java b/Java/Endpoint Examples/Multipart Payload/FlattenedTransparenciesPDF.java index 2a926cf2..3c3ff38c 100644 --- a/Java/Endpoint Examples/Multipart Payload/FlattenedTransparenciesPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/FlattenedTransparenciesPDF.java @@ -7,6 +7,14 @@ public class FlattenedTransparenciesPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/flattened-transparencies-pdf") + .url(API_URL + "/flattened-transparencies-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/GetResource.java b/Java/Endpoint Examples/Multipart Payload/GetResource.java index 769213f0..c80b7e89 100644 --- a/Java/Endpoint Examples/Multipart Payload/GetResource.java +++ b/Java/Endpoint Examples/Multipart Payload/GetResource.java @@ -7,6 +7,14 @@ public class GetResource { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Resource UUIDs can be found in the JSON response of POST requests as "outputId". // Resource UUIDs usually look like this: '0950b9bdf-0465-4d3f-8ea3-d2894f1ae839'. private static final String FILE_ID = @@ -19,8 +27,7 @@ public class GetResource { public static void main(String[] args) { try { - String urlString = - String.format("https://api.pdfrest.com/resource/%s?format=%2s", FILE_ID, OUTPUT_FORMAT); + String urlString = String.format(API_URL + "/resource/%s?format=%2s", FILE_ID, OUTPUT_FORMAT); InputStream in = new URL(urlString).openStream(); Files.copy(in, Paths.get("/path/to/write/file")); // Set a path for the file to be written } catch (IOException e) { diff --git a/Java/Endpoint Examples/Multipart Payload/Gif.java b/Java/Endpoint Examples/Multipart Payload/Gif.java index c4f1bfa1..519a6799 100644 --- a/Java/Endpoint Examples/Multipart Payload/Gif.java +++ b/Java/Endpoint Examples/Multipart Payload/Gif.java @@ -7,6 +7,14 @@ public class Gif { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/gif") + .url(API_URL + "/gif") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Jpg.java b/Java/Endpoint Examples/Multipart Payload/Jpg.java index 2f789502..acc3ed28 100644 --- a/Java/Endpoint Examples/Multipart Payload/Jpg.java +++ b/Java/Endpoint Examples/Multipart Payload/Jpg.java @@ -7,6 +7,14 @@ public class Jpg { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/jpg") + .url(API_URL + "/jpg") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/LinearizedPDF.java b/Java/Endpoint Examples/Multipart Payload/LinearizedPDF.java index d893fe45..ebe13bcc 100644 --- a/Java/Endpoint Examples/Multipart Payload/LinearizedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/LinearizedPDF.java @@ -7,6 +7,14 @@ public class LinearizedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/linearized-pdf") + .url(API_URL + "/linearized-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Markdown.java b/Java/Endpoint Examples/Multipart Payload/Markdown.java index 79661866..3d05757f 100644 --- a/Java/Endpoint Examples/Multipart Payload/Markdown.java +++ b/Java/Endpoint Examples/Multipart Payload/Markdown.java @@ -11,6 +11,14 @@ public class Markdown { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -39,7 +47,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/markdown") + .url(API_URL + "/markdown") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/MergedPDF.java b/Java/Endpoint Examples/Multipart Payload/MergedPDF.java index 513a52d5..1dcc62d4 100644 --- a/Java/Endpoint Examples/Multipart Payload/MergedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/MergedPDF.java @@ -11,6 +11,14 @@ public class MergedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the paths to your file here, or as the arguments when running the program. private static final String[] DEFAULT_FILE_PATHS = new String[] {"/path/to/file1.pdf", "/path/to/file2.pdf"}; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/merged-pdf") + .url(API_URL + "/merged-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDF.java b/Java/Endpoint Examples/Multipart Payload/PDF.java index 1bc0aceb..43748443 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDF.java +++ b/Java/Endpoint Examples/Multipart Payload/PDF.java @@ -7,6 +7,14 @@ public class PDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf") + .url(API_URL + "/pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFA.java b/Java/Endpoint Examples/Multipart Payload/PDFA.java index 700802dd..ea2d7387 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFA.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFA.java @@ -7,6 +7,14 @@ public class PDFA { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -36,7 +44,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdfa") + .url(API_URL + "/pdfa") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFInfo.java b/Java/Endpoint Examples/Multipart Payload/PDFInfo.java index 4bd11393..5e852b7e 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFInfo.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFInfo.java @@ -7,6 +7,14 @@ public class PDFInfo { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-info") + .url(API_URL + "/pdf-info") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithAcroforms.java b/Java/Endpoint Examples/Multipart Payload/PDFWithAcroforms.java index c3939b80..90c4cacc 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithAcroforms.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithAcroforms.java @@ -11,6 +11,14 @@ public class PDFWithAcroforms { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -38,7 +46,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-acroforms") + .url(API_URL + "/pdf-with-acroforms") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithAddedAttachment.java b/Java/Endpoint Examples/Multipart Payload/PDFWithAddedAttachment.java index 82be337d..8967b56c 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithAddedAttachment.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithAddedAttachment.java @@ -12,6 +12,14 @@ public class PDFWithAddedAttachment { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -48,7 +56,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-attachment") + .url(API_URL + "/pdf-with-added-attachment") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithAddedImage.java b/Java/Endpoint Examples/Multipart Payload/PDFWithAddedImage.java index 758a7e52..3c70911d 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithAddedImage.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithAddedImage.java @@ -7,6 +7,14 @@ public class PDFWithAddedImage { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -46,7 +54,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-image") + .url(API_URL + "/pdf-with-added-image") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithAddedText.java b/Java/Endpoint Examples/Multipart Payload/PDFWithAddedText.java index ee99e650..6b97bbf6 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithAddedText.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithAddedText.java @@ -7,6 +7,14 @@ public class PDFWithAddedText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -38,7 +46,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-added-text") + .url(API_URL + "/pdf-with-added-text") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithConvertedColors.java b/Java/Endpoint Examples/Multipart Payload/PDFWithConvertedColors.java index a6696dc2..478f2e22 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithConvertedColors.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithConvertedColors.java @@ -12,6 +12,14 @@ public class PDFWithConvertedColors { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -43,7 +51,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-converted-colors") + .url(API_URL + "/pdf-with-converted-colors") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithImportedFormData.java b/Java/Endpoint Examples/Multipart Payload/PDFWithImportedFormData.java index 850cbb2c..60662acc 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithImportedFormData.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithImportedFormData.java @@ -7,6 +7,14 @@ public class PDFWithImportedFormData { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -43,7 +51,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-imported-form-data") + .url(API_URL + "/pdf-with-imported-form-data") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithOCRText.java b/Java/Endpoint Examples/Multipart Payload/PDFWithOCRText.java index a24ba998..a81d58aa 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithOCRText.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithOCRText.java @@ -12,6 +12,14 @@ public class PDFWithOCRText { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -40,7 +48,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-ocr-text") + .url(API_URL + "/pdf-with-ocr-text") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithPageBoxesSet.java b/Java/Endpoint Examples/Multipart Payload/PDFWithPageBoxesSet.java index ada82fe4..76c9a8e5 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithPageBoxesSet.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithPageBoxesSet.java @@ -8,6 +8,14 @@ public class PDFWithPageBoxesSet { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -56,7 +64,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-page-boxes-set") + .url(API_URL + "/pdf-with-page-boxes-set") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextApplied.java b/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextApplied.java index 770e598c..697d742d 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextApplied.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextApplied.java @@ -12,6 +12,14 @@ public class PDFWithRedactedTextApplied { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -41,7 +49,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-redacted-text-applied") + .url(API_URL + "/pdf-with-redacted-text-applied") .post(requestBody) .build(); try { @@ -71,7 +79,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextPreview.java b/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextPreview.java index f85a2102..2df375e6 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextPreview.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFWithRedactedTextPreview.java @@ -7,6 +7,14 @@ public class PDFWithRedactedTextPreview { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file"; @@ -39,7 +47,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdf-with-redacted-text-preview") + .url(API_URL + "/pdf-with-redacted-text-preview") .post(requestBody) .build(); try { @@ -71,7 +79,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/PDFX.java b/Java/Endpoint Examples/Multipart Payload/PDFX.java index c38cac5f..a7886a6e 100644 --- a/Java/Endpoint Examples/Multipart Payload/PDFX.java +++ b/Java/Endpoint Examples/Multipart Payload/PDFX.java @@ -7,6 +7,14 @@ public class PDFX { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -36,7 +44,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/pdfx") + .url(API_URL + "/pdfx") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Png.java b/Java/Endpoint Examples/Multipart Payload/Png.java index 42487a9e..ef5f1458 100644 --- a/Java/Endpoint Examples/Multipart Payload/Png.java +++ b/Java/Endpoint Examples/Multipart Payload/Png.java @@ -7,6 +7,14 @@ public class Png { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/png") + .url(API_URL + "/png") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Powerpoint.java b/Java/Endpoint Examples/Multipart Payload/Powerpoint.java index e03f67e7..09b4d37e 100644 --- a/Java/Endpoint Examples/Multipart Payload/Powerpoint.java +++ b/Java/Endpoint Examples/Multipart Payload/Powerpoint.java @@ -12,6 +12,14 @@ public class Powerpoint { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -40,7 +48,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/powerpoint") + .url(API_URL + "/powerpoint") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/RasterizedPDF.java b/Java/Endpoint Examples/Multipart Payload/RasterizedPDF.java index 856ce02f..55417034 100644 --- a/Java/Endpoint Examples/Multipart Payload/RasterizedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/RasterizedPDF.java @@ -7,6 +7,14 @@ public class RasterizedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/rasterized-pdf") + .url(API_URL + "/rasterized-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/RequestStatus.java b/Java/Endpoint Examples/Multipart Payload/RequestStatus.java index 0dc6e4e5..d7f581c3 100644 --- a/Java/Endpoint Examples/Multipart Payload/RequestStatus.java +++ b/Java/Endpoint Examples/Multipart Payload/RequestStatus.java @@ -7,6 +7,14 @@ public class RequestStatus { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -67,7 +75,7 @@ private static String getPdfaResponse(File inputFile, String apiKey) { new Request.Builder() .header("Api-Key", apiKey) .header("response-type", "requestId") - .url("https://api.pdfrest.com/pdfa") + .url(API_URL + "/pdfa") .post(requestBody) .build(); try { @@ -85,7 +93,7 @@ private static String getPdfaResponse(File inputFile, String apiKey) { } private static String getRequestStatusResponse(String requestId, String apiKey) { - String urlString = String.format("https://api.pdfrest.com/request-status/%s", requestId); + String urlString = String.format(API_URL + "/request-status/%s", requestId); Request request = new Request.Builder().header("Api-Key", apiKey).url(urlString).get().build(); try { OkHttpClient client = diff --git a/Java/Endpoint Examples/Multipart Payload/RestrictedPDF.java b/Java/Endpoint Examples/Multipart Payload/RestrictedPDF.java index e91c75a0..24a0a729 100644 --- a/Java/Endpoint Examples/Multipart Payload/RestrictedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/RestrictedPDF.java @@ -7,6 +7,14 @@ public class RestrictedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -40,7 +48,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/restricted-pdf") + .url(API_URL + "/restricted-pdf") .post(requestBody) .build(); try { @@ -70,7 +78,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/SignedPDF.java b/Java/Endpoint Examples/Multipart Payload/SignedPDF.java index 1631c79d..a3184f82 100644 --- a/Java/Endpoint Examples/Multipart Payload/SignedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/SignedPDF.java @@ -7,6 +7,14 @@ public class SignedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -78,7 +86,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/signed-pdf") + .url(API_URL + "/signed-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/SignedPDFNonPFX.java b/Java/Endpoint Examples/Multipart Payload/SignedPDFNonPFX.java index 4b2f470d..275df616 100644 --- a/Java/Endpoint Examples/Multipart Payload/SignedPDFNonPFX.java +++ b/Java/Endpoint Examples/Multipart Payload/SignedPDFNonPFX.java @@ -7,6 +7,14 @@ public class SignedPDFNonPFX { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify your API key here, or in the environment variable PDFREST_API_KEY. // You can also put the environment variable in a .env file. private static final String DEFAULT_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -67,7 +75,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/signed-pdf") + .url(API_URL + "/signed-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/SplitPDF.java b/Java/Endpoint Examples/Multipart Payload/SplitPDF.java index 8dab71d3..d0808f3f 100644 --- a/Java/Endpoint Examples/Multipart Payload/SplitPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/SplitPDF.java @@ -7,6 +7,14 @@ public class SplitPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -37,7 +45,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/split-pdf") + .url(API_URL + "/split-pdf") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Tif.java b/Java/Endpoint Examples/Multipart Payload/Tif.java index 07541f67..125b1c16 100644 --- a/Java/Endpoint Examples/Multipart Payload/Tif.java +++ b/Java/Endpoint Examples/Multipart Payload/Tif.java @@ -7,6 +7,14 @@ public class Tif { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -35,7 +43,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/tif") + .url(API_URL + "/tif") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/UnrestrictedPDF.java b/Java/Endpoint Examples/Multipart Payload/UnrestrictedPDF.java index 91b41c5a..67f07aa5 100644 --- a/Java/Endpoint Examples/Multipart Payload/UnrestrictedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/UnrestrictedPDF.java @@ -7,6 +7,14 @@ public class UnrestrictedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -37,7 +45,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/unrestricted-pdf") + .url(API_URL + "/unrestricted-pdf") .post(requestBody) .build(); try { @@ -68,7 +76,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/Unzip.java b/Java/Endpoint Examples/Multipart Payload/Unzip.java index eee6e728..98ca6283 100644 --- a/Java/Endpoint Examples/Multipart Payload/Unzip.java +++ b/Java/Endpoint Examples/Multipart Payload/Unzip.java @@ -7,6 +7,14 @@ public class Unzip { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.zip"; @@ -34,7 +42,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/unzip") + .url(API_URL + "/unzip") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/UpToolkit.java b/Java/Endpoint Examples/Multipart Payload/UpToolkit.java index 561cb4bd..13b24d29 100644 --- a/Java/Endpoint Examples/Multipart Payload/UpToolkit.java +++ b/Java/Endpoint Examples/Multipart Payload/UpToolkit.java @@ -7,9 +7,17 @@ public class UpToolkit { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + public static void main(String[] args) { // up-forms and up-office can be used to query the other tools - Request request = new Request.Builder().url("https://api.pdfrest.com/up-toolkit").get().build(); + Request request = new Request.Builder().url(API_URL + "/up-toolkit").get().build(); try { OkHttpClient client = new OkHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build(); diff --git a/Java/Endpoint Examples/Multipart Payload/Upload.java b/Java/Endpoint Examples/Multipart Payload/Upload.java index 9700da18..d6e885ee 100644 --- a/Java/Endpoint Examples/Multipart Payload/Upload.java +++ b/Java/Endpoint Examples/Multipart Payload/Upload.java @@ -6,6 +6,14 @@ public class Upload { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the paths to your file here, or as the arguments when running the program. private static final String[] DEFAULT_FILE_PATHS = new String[] {"/path/to/file1.pdf", "/path/to/file2.pdf"}; @@ -38,7 +46,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/upload") + .url(API_URL + "/upload") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/WatermarkedPDF.java b/Java/Endpoint Examples/Multipart Payload/WatermarkedPDF.java index 6b8b0a03..bb2aa48a 100644 --- a/Java/Endpoint Examples/Multipart Payload/WatermarkedPDF.java +++ b/Java/Endpoint Examples/Multipart Payload/WatermarkedPDF.java @@ -7,6 +7,14 @@ public class WatermarkedPDF { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -37,7 +45,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/watermarked-pdf") + .url(API_URL + "/watermarked-pdf") .post(requestBody) .build(); try { @@ -68,7 +76,7 @@ public static void main(String[] args) { Request deleteRequest = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/delete") + .url(API_URL + "/delete") .post(deleteBody) .build(); try (Response deleteResp = diff --git a/Java/Endpoint Examples/Multipart Payload/Word.java b/Java/Endpoint Examples/Multipart Payload/Word.java index 3351d618..2533f5f3 100644 --- a/Java/Endpoint Examples/Multipart Payload/Word.java +++ b/Java/Endpoint Examples/Multipart Payload/Word.java @@ -12,6 +12,14 @@ public class Word { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the path to your file here, or as the first argument when running the program. private static final String DEFAULT_FILE_PATH = "/path/to/file.pdf"; @@ -40,7 +48,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/word") + .url(API_URL + "/word") .post(requestBody) .build(); try { diff --git a/Java/Endpoint Examples/Multipart Payload/Zip.java b/Java/Endpoint Examples/Multipart Payload/Zip.java index 69b2ac36..2e94ad7d 100644 --- a/Java/Endpoint Examples/Multipart Payload/Zip.java +++ b/Java/Endpoint Examples/Multipart Payload/Zip.java @@ -6,6 +6,14 @@ public class Zip { + // By default, we use the US-based API service. This is the primary endpoint for global use. + private static final String API_URL = "https://api.pdfrest.com"; + + // For GDPR compliance and enhanced performance for European users, you can switch to the EU-based + // service by commenting out the URL above and uncommenting the URL below. + // For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + // private static final String API_URL = "https://eu-api.pdfrest.com"; + // Specify the paths to your file here, or as the arguments when running the program. private static final String[] DEFAULT_FILE_PATHS = new String[] {"/path/to/file1.pdf", "/path/to/file2.pdf"}; @@ -38,7 +46,7 @@ public static void main(String[] args) { Request request = new Request.Builder() .header("Api-Key", dotenv.get("PDFREST_API_KEY", DEFAULT_API_KEY)) - .url("https://api.pdfrest.com/zip") + .url(API_URL + "/zip") .post(requestBody) .build(); try { diff --git a/JavaScript/Complex Flow Examples/decrypt-add-reencrypt.js b/JavaScript/Complex Flow Examples/decrypt-add-reencrypt.js index b77fc9bb..03f20327 100644 --- a/JavaScript/Complex Flow Examples/decrypt-add-reencrypt.js +++ b/JavaScript/Complex Flow Examples/decrypt-add-reencrypt.js @@ -11,6 +11,14 @@ var fs = require("fs"); * lock it up again. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var decryptRequestData = new FormData(); @@ -20,7 +28,7 @@ decryptRequestData.append("current_open_password", "current_example_pw"); var decryptConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/decrypted-pdf", + url: apiUrl + "/decrypted-pdf", headers: { "Api-Key": apiKey, ...decryptRequestData.getHeaders(), @@ -41,7 +49,7 @@ axios(decryptConfig) var addImageConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-added-image", + url: apiUrl + "/pdf-with-added-image", headers: { "Api-Key": apiKey, ...data.getHeaders(), @@ -58,7 +66,7 @@ axios(decryptConfig) var encryptConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/encrypted-pdf", + url: apiUrl + "/encrypted-pdf", headers: { "Api-Key": apiKey, ...data.getHeaders(), diff --git a/JavaScript/Complex Flow Examples/merge-different-file-types.js b/JavaScript/Complex Flow Examples/merge-different-file-types.js index 6c066cc8..8cc98fc3 100644 --- a/JavaScript/Complex Flow Examples/merge-different-file-types.js +++ b/JavaScript/Complex Flow Examples/merge-different-file-types.js @@ -14,6 +14,14 @@ First, we will upload an image file to the /pdf route and capture the output ID. * that the /pdf route takes as inputs. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var imageData = new FormData(); @@ -22,7 +30,7 @@ imageData.append("file", fs.createReadStream("/path/to/image.png")); var imageConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf", + url: apiUrl + "/pdf", headers: { "Api-Key": apiKey, ...imageData.getHeaders(), @@ -40,7 +48,7 @@ axios(imageConfig) var pptConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf", + url: apiUrl + "/pdf", headers: { "Api-Key": apiKey, ...pptData.getHeaders(), @@ -64,7 +72,7 @@ axios(imageConfig) var mergeConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/merged-pdf", + url: apiUrl + "/merged-pdf", headers: { "Api-Key": apiKey, ...mergeData.getHeaders(), diff --git a/JavaScript/Complex Flow Examples/ocr-with-extract-text.js b/JavaScript/Complex Flow Examples/ocr-with-extract-text.js index 17b053bd..781c12f2 100644 --- a/JavaScript/Complex Flow Examples/ocr-with-extract-text.js +++ b/JavaScript/Complex Flow Examples/ocr-with-extract-text.js @@ -11,6 +11,14 @@ var fs = require("fs"); * return the newly added text. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var ocrData = new FormData(); @@ -20,7 +28,7 @@ ocrData.append("output", "example_pdf-with-ocr-text_out"); var ocrConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-ocr-text", + url: apiUrl + "/pdf-with-ocr-text", headers: { "Api-Key": apiKey, ...ocrData.getHeaders(), @@ -43,7 +51,7 @@ axios(ocrConfig) var extractConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/extracted-text", + url: apiUrl + "/extracted-text", headers: { "Api-Key": apiKey, ...extractData.getHeaders(), @@ -71,4 +79,4 @@ axios(ocrConfig) }) .catch(function (error) { console.log(error.response ? error.response.data : error.message); - }); \ No newline at end of file + }); diff --git a/JavaScript/Complex Flow Examples/pdfa-3b-with-attachment.js b/JavaScript/Complex Flow Examples/pdfa-3b-with-attachment.js index fc06fe44..2c504630 100644 --- a/JavaScript/Complex Flow Examples/pdfa-3b-with-attachment.js +++ b/JavaScript/Complex Flow Examples/pdfa-3b-with-attachment.js @@ -12,6 +12,14 @@ var fs = require("fs"); * file may be attached and wrapped into the PDF/A conversion. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var attachData = new FormData(); @@ -25,7 +33,7 @@ attachData.append("output", "pdfrest_pdf_with_added_attachment"); var attachConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-added-attachment", + url: apiUrl + "/pdf-with-added-attachment", headers: { "Api-Key": apiKey, ...attachData.getHeaders(), @@ -45,7 +53,7 @@ axios(attachConfig) var pdfaConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdfa", + url: apiUrl + "/pdfa", headers: { "Api-Key": apiKey, ...pdfaData.getHeaders(), diff --git a/JavaScript/Complex Flow Examples/preserve-word-document.js b/JavaScript/Complex Flow Examples/preserve-word-document.js index 39ac600e..52c99269 100644 --- a/JavaScript/Complex Flow Examples/preserve-word-document.js +++ b/JavaScript/Complex Flow Examples/preserve-word-document.js @@ -9,6 +9,14 @@ var fs = require("fs"); * and convert it to the PDF/A format for long-term storage. */ + // By default, we use the US-based API service. This is the primary endpoint for global use. + var apiUrl = "https://api.pdfrest.com"; + + /* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ + //var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var pdfData = new FormData(); @@ -17,7 +25,7 @@ pdfData.append("file", fs.createReadStream("/path/to/word.doc")); var pdfConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf", + url: apiUrl + "/pdf", headers: { "Api-Key": apiKey, ...pdfData.getHeaders(), @@ -37,7 +45,7 @@ axios(pdfConfig) var pdfaConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdfa", + url: apiUrl + "/pdfa", headers: { "Api-Key": apiKey, ...pdfaData.getHeaders(), diff --git a/JavaScript/Complex Flow Examples/protected-watermark.js b/JavaScript/Complex Flow Examples/protected-watermark.js index 41bcef2c..973b8a7c 100644 --- a/JavaScript/Complex Flow Examples/protected-watermark.js +++ b/JavaScript/Complex Flow Examples/protected-watermark.js @@ -9,6 +9,14 @@ var fs = require("fs"); * and then /restricted-pdf to lock the watermark in. */ + // By default, we use the US-based API service. This is the primary endpoint for global use. + var apiUrl = "https://api.pdfrest.com"; + + /* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ + //var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var watermarkData = new FormData(); @@ -18,7 +26,7 @@ watermarkData.append("watermark_text", "Watermarked"); var watermarkConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/watermarked-pdf", + url: apiUrl + "/watermarked-pdf", headers: { "Api-Key": apiKey, ...watermarkData.getHeaders(), @@ -40,7 +48,7 @@ axios(watermarkConfig) var restrictConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/restricted-pdf", + url: apiUrl + "/restricted-pdf", headers: { "Api-Key": apiKey, ...data.getHeaders(), diff --git a/JavaScript/Complex Flow Examples/redact-preview-and-finalize.js b/JavaScript/Complex Flow Examples/redact-preview-and-finalize.js index 9b693f2b..396ad3a4 100644 --- a/JavaScript/Complex Flow Examples/redact-preview-and-finalize.js +++ b/JavaScript/Complex Flow Examples/redact-preview-and-finalize.js @@ -10,6 +10,14 @@ var fs = require("fs"); * redacted as intended. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key var previewData = new FormData(); @@ -26,7 +34,7 @@ previewData.append('redactions', JSON.stringify(redaction_option_array)); var previewConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-redacted-text-preview", + url: apiUrl + "/pdf-with-redacted-text-preview", headers: { "Api-Key": apiKey, ...previewData.getHeaders(), @@ -45,7 +53,7 @@ axios(previewConfig) var appliedConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-redacted-text-applied", + url: apiUrl + "/pdf-with-redacted-text-applied", headers: { "Api-Key": apiKey, ...appliedData.getHeaders(), diff --git a/JavaScript/Endpoint Examples/JSON Payload/batch-delete.js b/JavaScript/Endpoint Examples/JSON Payload/batch-delete.js index a7517e66..1b656795 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/batch-delete.js +++ b/JavaScript/Endpoint Examples/JSON Payload/batch-delete.js @@ -1,9 +1,17 @@ const axios = require("axios"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + let config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "api-key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/bmp.js b/JavaScript/Endpoint Examples/JSON Payload/bmp.js index d6115750..218164c4 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/bmp.js +++ b/JavaScript/Endpoint Examples/JSON Payload/bmp.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var bmp_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/bmp", + url: apiUrl + "/bmp", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/compressed-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/compressed-pdf.js index 4c42ccec..f03398da 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/compressed-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/compressed-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var compress_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/compressed-pdf", + url: apiUrl + "/compressed-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/decrypted-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/decrypted-pdf.js index 06dd620e..d49bf704 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/decrypted-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/decrypted-pdf.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -28,7 +36,7 @@ axios(upload_config) var decrypt_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/decrypted-pdf", + url: apiUrl + "/decrypted-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -41,9 +49,9 @@ axios(upload_config) .then(function (decrypt_response) { console.log(JSON.stringify(decrypt_response.data)); - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -54,7 +62,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/delete-resource.js b/JavaScript/Endpoint Examples/JSON Payload/delete-resource.js index 7282e9ec..87e3efce 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/delete-resource.js +++ b/JavaScript/Endpoint Examples/JSON Payload/delete-resource.js @@ -1,9 +1,17 @@ const axios = require("axios"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + let config = { method: "delete", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + url: apiUrl + "/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", headers: { "api-key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", }, diff --git a/JavaScript/Endpoint Examples/JSON Payload/encrypted-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/encrypted-pdf.js index 58cf8ab6..facea3a0 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/encrypted-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/encrypted-pdf.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -28,7 +36,7 @@ axios(upload_config) var encrypt_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/encrypted-pdf", + url: apiUrl + "/encrypted-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -42,9 +50,9 @@ axios(upload_config) console.log(JSON.stringify(encrypt_response.data)); var encrypted_output_id = encrypt_response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/excel.js b/JavaScript/Endpoint Examples/JSON Payload/excel.js index 2902734b..e63e1d3b 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/excel.js +++ b/JavaScript/Endpoint Examples/JSON Payload/excel.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var excel_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/excel", + url: apiUrl + "/excel", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/exported-form-data.js b/JavaScript/Endpoint Examples/JSON Payload/exported-form-data.js index 9402afbc..10c7449f 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/exported-form-data.js +++ b/JavaScript/Endpoint Examples/JSON Payload/exported-form-data.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var export_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/exported-form-data", + url: apiUrl + "/exported-form-data", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/extracted-images.js b/JavaScript/Endpoint Examples/JSON Payload/extracted-images.js index 50516c79..0a334a88 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/extracted-images.js +++ b/JavaScript/Endpoint Examples/JSON Payload/extracted-images.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var extract_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/extracted-images", + url: apiUrl + "/extracted-images", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/extracted-text.js b/JavaScript/Endpoint Examples/JSON Payload/extracted-text.js index e2471906..2e9eb7f4 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/extracted-text.js +++ b/JavaScript/Endpoint Examples/JSON Payload/extracted-text.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var extract_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/extracted-text", + url: apiUrl + "/extracted-text", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/flattened-annotations-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/flattened-annotations-pdf.js index a26127e3..a8d2de8b 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/flattened-annotations-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/flattened-annotations-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var flatten_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/flattened-annotations-pdf", + url: apiUrl + "/flattened-annotations-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/flattened-forms-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/flattened-forms-pdf.js index cbad5f4b..389d45a3 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/flattened-forms-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/flattened-forms-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var flatten_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/flattened-forms-pdf", + url: apiUrl + "/flattened-forms-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/flattened-layers-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/flattened-layers-pdf.js index 0646acd2..08d9dff3 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/flattened-layers-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/flattened-layers-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var flatten_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/flattened-layers-pdf", + url: apiUrl + "/flattened-layers-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.js index e69969f8..52f9263e 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var flatten_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/flattened-transparencies-pdf", + url: apiUrl + "/flattened-transparencies-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/get-resource.js b/JavaScript/Endpoint Examples/JSON Payload/get-resource.js index 1683e486..384ca1c6 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/get-resource.js +++ b/JavaScript/Endpoint Examples/JSON Payload/get-resource.js @@ -1,10 +1,18 @@ // This request demonstrates how to retrieve a resource using an ID. const axios = require('axios'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + let config = { method: 'get', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url', + url: apiUrl + "/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url", headers: { } }; diff --git a/JavaScript/Endpoint Examples/JSON Payload/gif.js b/JavaScript/Endpoint Examples/JSON Payload/gif.js index 32649ffb..bcf8ecdc 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/gif.js +++ b/JavaScript/Endpoint Examples/JSON Payload/gif.js @@ -2,12 +2,22 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); + +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +35,7 @@ axios(upload_config) var gif_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/gif", + url: apiUrl + "/gif", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/jpg.js b/JavaScript/Endpoint Examples/JSON Payload/jpg.js index 5be23385..39b5fa36 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/jpg.js +++ b/JavaScript/Endpoint Examples/JSON Payload/jpg.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var jpg_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/jpg", + url: apiUrl + "/jpg", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/linearized-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/linearized-pdf.js index 1b2cfc07..b54b5905 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/linearized-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/linearized-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var linearize_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/linearized-pdf", + url: apiUrl + "/linearized-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/markdown.js b/JavaScript/Endpoint Examples/JSON Payload/markdown.js index 91b24b69..036d9e4f 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/markdown.js +++ b/JavaScript/Endpoint Examples/JSON Payload/markdown.js @@ -1,12 +1,20 @@ var axios = require("axios"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file.pdf"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -26,7 +34,7 @@ axios(upload_config) var markdown_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/markdown", + url: apiUrl + "/markdown", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -51,4 +59,4 @@ axios(upload_config) .catch(function (error) { console.error("Upload request error:"); console.error(error.response?.data || error.message); - }); \ No newline at end of file + }); diff --git a/JavaScript/Endpoint Examples/JSON Payload/merged-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/merged-pdf.js index 9fa5a7ad..9f5f39e3 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/merged-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/merged-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var first_upload_data = fs.createReadStream("/path/to/first_file"); var first_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "first_filename.pdf", @@ -26,7 +34,7 @@ axios(first_upload_config) var second_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "second_filename.pdf", @@ -43,7 +51,7 @@ axios(first_upload_config) var merge_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/merged-pdf", + url: apiUrl + "/merged-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-info.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-info.js index c90b029c..4dcd85fb 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-info.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-info.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var info_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-info", + url: apiUrl + "/pdf-info", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-acroforms.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-acroforms.js index 80dd7111..92d31be8 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-acroforms.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-acroforms.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var acroform_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-acroforms", + url: apiUrl + "/pdf-with-acroforms", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-attachment.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-attachment.js index 37fd8dd7..883bcc8c 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-attachment.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-attachment.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var pdf_upload_data = fs.createReadStream("/path/to/pdf_file"); var pdf_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "pdf_filename.pdf", @@ -28,7 +36,7 @@ axios(pdf_upload_config) var attachment_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "attachment_filename.xml", @@ -46,7 +54,7 @@ axios(pdf_upload_config) var attach_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-added-attachment", + url: apiUrl + "/pdf-with-added-attachment", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-image.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-image.js index f5e30206..9a79af53 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-image.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-image.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var pdf_upload_data = fs.createReadStream("/path/to/pdf_file"); var pdf_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "pdf_filename.pdf", @@ -26,7 +34,7 @@ axios(pdf_upload_config) var image_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "image_filename.png", @@ -43,7 +51,7 @@ axios(pdf_upload_config) var add_image_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-added-image", + url: apiUrl + "/pdf-with-added-image", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-text.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-text.js index c5f8c7de..99c9953b 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-text.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-added-text.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -39,7 +47,7 @@ axios(upload_config) var add_text_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-added-text", + url: apiUrl + "/pdf-with-added-text", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-converted-colors.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-converted-colors.js index 82c80b81..f0773c76 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-converted-colors.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-converted-colors.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var convert_colors_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-converted-colors", + url: apiUrl + "/pdf-with-converted-colors", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.js index c126c3d1..a2aeed2d 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var pdf_upload_data = fs.createReadStream("/path/to/pdf_file"); var pdf_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "pdf_filename.pdf", @@ -26,7 +34,7 @@ axios(pdf_upload_config) var data_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "data_filename.xml", @@ -43,7 +51,7 @@ axios(pdf_upload_config) var import_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-imported-form-data", + url: apiUrl + "/pdf-with-imported-form-data", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-ocr-text.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-ocr-text.js index 1572f2d1..b82f618d 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-ocr-text.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-ocr-text.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var pdf_with_ocr_text_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-ocr-text", + url: apiUrl + "/pdf-with-ocr-text", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.js index 71f29f39..90e401fb 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -42,7 +50,7 @@ axios(upload_config) var boxes_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-page-boxes-set", + url: apiUrl + "/pdf-with-page-boxes-set", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.js index deabb033..0e9bef15 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -28,7 +36,7 @@ axios(upload_config) var pdf_with_redacted_text_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-redacted-text-applied", + url: apiUrl + "/pdf-with-redacted-text-applied", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -42,9 +50,9 @@ axios(upload_config) console.log(JSON.stringify(pdf_with_redacted_text_response.data)); var applied_output_id = pdf_with_redacted_text_response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.js b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.js index 745bc298..2b8a2132 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -45,7 +53,7 @@ axios(upload_config) var redact_text_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf-with-redacted-text-preview", + url: apiUrl + "/pdf-with-redacted-text-preview", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -61,9 +69,9 @@ axios(upload_config) .then(function (redact_text_response) { console.log(JSON.stringify(redact_text_response.data)); - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -74,7 +82,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdf.js b/JavaScript/Endpoint Examples/JSON Payload/pdf.js index 69d176f5..957cc375 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.png", @@ -25,7 +33,7 @@ axios(upload_config) var pdf_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdf", + url: apiUrl + "/pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdfa.js b/JavaScript/Endpoint Examples/JSON Payload/pdfa.js index 5d5323ca..538dcdfe 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdfa.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdfa.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var pdfa_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdfa", + url: apiUrl + "/pdfa", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/pdfx.js b/JavaScript/Endpoint Examples/JSON Payload/pdfx.js index 4b5d0b4c..0c74aa5a 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/pdfx.js +++ b/JavaScript/Endpoint Examples/JSON Payload/pdfx.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var pdfx_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/pdfx", + url: apiUrl + "/pdfx", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/png.js b/JavaScript/Endpoint Examples/JSON Payload/png.js index 8872625a..42a45c1b 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/png.js +++ b/JavaScript/Endpoint Examples/JSON Payload/png.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var png_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/png", + url: apiUrl + "/png", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/powerpoint.js b/JavaScript/Endpoint Examples/JSON Payload/powerpoint.js index b5758033..fde12297 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/powerpoint.js +++ b/JavaScript/Endpoint Examples/JSON Payload/powerpoint.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var powerpoint_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/powerpoint", + url: apiUrl + "/powerpoint", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/rasterized-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/rasterized-pdf.js index 7a28800f..8fd84c9a 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/rasterized-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/rasterized-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var rasterize_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/rasterized-pdf", + url: apiUrl + "/rasterized-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/restricted-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/restricted-pdf.js index 4c593139..e6581064 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/restricted-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/restricted-pdf.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -28,7 +36,7 @@ axios(upload_config) var restrict_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/restricted-pdf", + url: apiUrl + "/restricted-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -46,9 +54,9 @@ axios(upload_config) console.log(JSON.stringify(restrict_response.data)); var restricted_output_id = restrict_response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -56,7 +64,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.js b/JavaScript/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.js index c8582d02..8a6058ae 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.js +++ b/JavaScript/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.js @@ -1,12 +1,20 @@ import axios from "axios"; import fs from "fs"; +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + async function uploadFile(filePath, fileName) { var upload_data = fs.createReadStream(filePath); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": fileName, @@ -40,7 +48,7 @@ function signPdf(input_id, certificate_id, private_key_id) { var signed_pdf_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/signed-pdf", + url: apiUrl + "/signed-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -66,4 +74,4 @@ function signPdf(input_id, certificate_id, private_key_id) { const input_id = await uploadFile("/path/to/input.pdf", "input.pdf"); const certificate_id = await uploadFile("/path/to/certificate.pem", "certificate.pem"); const private_key_id = await uploadFile("/path/to/private_key.pem", "private_key.pem"); -signPdf(input_id, certificate_id, private_key_id); \ No newline at end of file +signPdf(input_id, certificate_id, private_key_id); diff --git a/JavaScript/Endpoint Examples/JSON Payload/signed-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/signed-pdf.js index be402727..9c6122c3 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/signed-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/signed-pdf.js @@ -1,12 +1,20 @@ import axios from "axios"; import fs from "fs"; +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + async function uploadFile(filePath, fileName) { var upload_data = fs.createReadStream(filePath); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": fileName, @@ -46,7 +54,7 @@ function signPdf(input_id, credential_id, passphrase_id, logo_id) { var signed_pdf_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/signed-pdf", + url: apiUrl + "/signed-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -74,4 +82,4 @@ const input_id = await uploadFile("/path/to/input.pdf", "input.pdf"); const credential_id = await uploadFile("/path/to/credentials.pfx", "credentials.pfx"); const passphrase_id = await uploadFile("/path/to/passphrase.txt", "passphrase.txt"); const logo_id = await uploadFile("/path/to/logo.png", "logo.png"); -signPdf(input_id, credential_id, passphrase_id, logo_id); \ No newline at end of file +signPdf(input_id, credential_id, passphrase_id, logo_id); diff --git a/JavaScript/Endpoint Examples/JSON Payload/split-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/split-pdf.js index 8b669564..bffbddab 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/split-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/split-pdf.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var split_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/split-pdf", + url: apiUrl + "/split-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/tif.js b/JavaScript/Endpoint Examples/JSON Payload/tif.js index 48dc5f70..0dea59a4 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/tif.js +++ b/JavaScript/Endpoint Examples/JSON Payload/tif.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var tif_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/tif", + url: apiUrl + "/tif", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/unrestricted-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/unrestricted-pdf.js index 589a78a7..0a0d74df 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/unrestricted-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/unrestricted-pdf.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -28,7 +36,7 @@ axios(upload_config) var unrestrict_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/unrestricted-pdf", + url: apiUrl + "/unrestricted-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -44,9 +52,9 @@ axios(upload_config) .then(function (unrestrict_response) { console.log(JSON.stringify(unrestrict_response.data)); - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -57,7 +65,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", @@ -74,7 +82,7 @@ axios(upload_config) console.log(error); }); } - + }) .catch(function (error) { console.log(error); diff --git a/JavaScript/Endpoint Examples/JSON Payload/unzip.js b/JavaScript/Endpoint Examples/JSON Payload/unzip.js index 7c3137eb..28e86bd3 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/unzip.js +++ b/JavaScript/Endpoint Examples/JSON Payload/unzip.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.zip", @@ -25,7 +33,7 @@ axios(upload_config) var unzip_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/unzip", + url: apiUrl + "/unzip", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/up-toolkit.js b/JavaScript/Endpoint Examples/JSON Payload/up-toolkit.js index bb20131e..c7296c6e 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/up-toolkit.js +++ b/JavaScript/Endpoint Examples/JSON Payload/up-toolkit.js @@ -1,10 +1,18 @@ // This request demonstrates how to check the status of the API servers const axios = require("axios"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + let config = { method: "get", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/up-toolkit", // up-forms and up-office can be used to query the other tools + url: apiUrl + "/up-toolkit", // up-forms and up-office can be used to query the other tools headers: {}, }; diff --git a/JavaScript/Endpoint Examples/JSON Payload/upload.js b/JavaScript/Endpoint Examples/JSON Payload/upload.js index 9cc0670c..55f3cdf1 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/upload.js +++ b/JavaScript/Endpoint Examples/JSON Payload/upload.js @@ -2,13 +2,21 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); // define configuration options for axios request var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", diff --git a/JavaScript/Endpoint Examples/JSON Payload/watermarked-pdf.js b/JavaScript/Endpoint Examples/JSON Payload/watermarked-pdf.js index c6c01336..47c58d24 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/watermarked-pdf.js +++ b/JavaScript/Endpoint Examples/JSON Payload/watermarked-pdf.js @@ -2,6 +2,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +18,7 @@ var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -28,7 +36,7 @@ axios(upload_config) var watermark_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/watermarked-pdf", + url: apiUrl + "/watermarked-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", @@ -45,9 +53,9 @@ axios(upload_config) console.log(JSON.stringify(watermark_response.data)); var watermarked_output_id = watermark_response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -55,7 +63,7 @@ axios(upload_config) var delete_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/delete", + url: apiUrl + "/delete", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/word.js b/JavaScript/Endpoint Examples/JSON Payload/word.js index 9682a19a..2a3268fa 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/word.js +++ b/JavaScript/Endpoint Examples/JSON Payload/word.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var upload_data = fs.createReadStream("/path/to/file"); var upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "filename.pdf", @@ -25,7 +33,7 @@ axios(upload_config) var word_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/word", + url: apiUrl + "/word", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/JSON Payload/zip.js b/JavaScript/Endpoint Examples/JSON Payload/zip.js index 3180ea9c..82632669 100644 --- a/JavaScript/Endpoint Examples/JSON Payload/zip.js +++ b/JavaScript/Endpoint Examples/JSON Payload/zip.js @@ -2,12 +2,20 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + var first_upload_data = fs.createReadStream("/path/to/first_file"); var first_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "first_filename.pdf", @@ -26,7 +34,7 @@ axios(first_upload_config) var second_upload_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/upload", + url: apiUrl + "/upload", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Filename": "second_filename.pdf", @@ -43,7 +51,7 @@ axios(first_upload_config) var zip_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/zip", + url: apiUrl + "/zip", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key "Content-Type": "application/json", diff --git a/JavaScript/Endpoint Examples/Multipart Payload/bmp.js b/JavaScript/Endpoint Examples/Multipart Payload/bmp.js index 453fa368..9fc1fd99 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/bmp.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/bmp.js @@ -3,20 +3,29 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + // Create a new form data instance and append the file and parameters to it var data = new FormData(); -data.append('file', fs.createReadStream('/path/to/file')); -data.append('pages', '1-last'); -data.append('resolution', '300'); -data.append('color_model', 'rgb'); -data.append('output', 'pdfrest_bmp'); +data.append('file', fs.createReadStream('/path/to/file')); +data.append('pages', '1-last'); +data.append('resolution', '300'); +data.append('color_model', 'rgb'); +data.append('output', 'pdfrest_bmp'); // define configuration options for axios request var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/bmp', - headers: { + url: apiUrl + '/bmp', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -29,8 +38,8 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/compressed-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/compressed-pdf.js index 9737274e..8e14e4aa 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/compressed-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/compressed-pdf.js @@ -3,6 +3,17 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); + +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -13,8 +24,8 @@ data.append('output', 'pdfrest_compressed_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/compressed-pdf', - headers: { + url: apiUrl + '/compressed-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -27,7 +38,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/decrypted-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/decrypted-pdf.js index cd243700..a4f6831d 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/decrypted-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/decrypted-pdf.js @@ -3,6 +3,17 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); + +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,14 +21,14 @@ const DELETE_SENSITIVE_FILES = false; var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); data.append('current_open_password', 'current_example_pw'); -data.append('output', 'pdfrest_decrypted_pdf'); +data.append('output', 'pdfrest_decrypted_pdf'); // Define configuration options for axios request var config = { method: 'post', maxBodyLength: Infinity, // Set maximum length of the request body - url: 'https://api.pdfrest.com/decrypted-pdf', - headers: { + url: apiUrl + '/decrypted-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // Set headers with form data headers }, @@ -29,9 +40,9 @@ axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -42,7 +53,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' @@ -55,7 +66,7 @@ axios(config) .then(function (delete_response) { console.log(JSON.stringify(delete_response.data)); }) .catch(function (error) { console.log(error); }); } - + }) .catch(function (error) { console.log(error); diff --git a/JavaScript/Endpoint Examples/Multipart Payload/delete-resource.js b/JavaScript/Endpoint Examples/Multipart Payload/delete-resource.js index 7282e9ec..f45e1701 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/delete-resource.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/delete-resource.js @@ -1,9 +1,18 @@ const axios = require("axios"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + let config = { method: "delete", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + url: apiUrl + "/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", headers: { "api-key": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", }, diff --git a/JavaScript/Endpoint Examples/Multipart Payload/encrypted-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/encrypted-pdf.js index 192b4fa4..fd3600fe 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/encrypted-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/encrypted-pdf.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -16,8 +24,8 @@ data.append('output', 'pdfrest_encrypted_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/encrypted-pdf', - headers: { + url: apiUrl + '/encrypted-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -30,9 +38,9 @@ axios(config) console.log(JSON.stringify(response.data)); var output_id = response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -42,7 +50,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' diff --git a/JavaScript/Endpoint Examples/Multipart Payload/excel.js b/JavaScript/Endpoint Examples/Multipart Payload/excel.js index 39aadcb3..a4b78bd5 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/excel.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/excel.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -12,8 +20,8 @@ data.append('output', 'pdfrest_excel_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/excel', - headers: { + url: apiUrl + '/excel', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -26,7 +34,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/exported-form-data.js b/JavaScript/Endpoint Examples/Multipart Payload/exported-form-data.js index da79e744..c14205d1 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/exported-form-data.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/exported-form-data.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -13,8 +21,8 @@ data.append('output', 'pdfrest_exported_form_data'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/exported-form-data', - headers: { + url: apiUrl + '/exported-form-data', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -30,4 +38,4 @@ axios(config) console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/extracted-images.js b/JavaScript/Endpoint Examples/Multipart Payload/extracted-images.js index c0f5b1fd..1e9c6271 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/extracted-images.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/extracted-images.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -13,8 +21,8 @@ data.append('output', 'pdfrest_extracted_images'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/extracted-images', - headers: { + url: apiUrl + '/extracted-images', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -27,7 +35,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js b/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js index 7a71269d..44d51b40 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js @@ -3,6 +3,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -12,7 +20,7 @@ data.append("word_style", "on"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/extracted-text", + url: apiUrl + "/extracted-text", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.js index f7da0eff..850febc1 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -14,7 +22,7 @@ data.append("output", "pdfrest_flattened_annotations_pdf"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/flattened-annotations-pdf", + url: apiUrl + "/flattened-annotations-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/flattened-forms-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/flattened-forms-pdf.js index 71af6b96..6b935110 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/flattened-forms-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/flattened-forms-pdf.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -14,7 +22,7 @@ data.append("output", "pdfrest_flattened_forms_pdf"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/flattened-forms-pdf", + url: apiUrl + "/flattened-forms-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/flattened-layers-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/flattened-layers-pdf.js index ca72fe4e..ac7b7012 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/flattened-layers-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/flattened-layers-pdf.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -14,7 +22,7 @@ data.append("output", "pdfrest_flattened_layers_pdf"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/flattened-layers-pdf", + url: apiUrl + "/flattened-layers-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.js index ad26a246..358b29d3 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.js @@ -3,6 +3,15 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -13,8 +22,8 @@ data.append('output', 'pdfrest_flattened_transparencies_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/flattened-transparencies-pdf', - headers: { + url: apiUrl + '/flattened-transparencies-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -27,7 +36,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/get-resource.js b/JavaScript/Endpoint Examples/Multipart Payload/get-resource.js index 1683e486..c88d0af3 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/get-resource.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/get-resource.js @@ -1,10 +1,18 @@ // This request demonstrates how to retrieve a resource using an ID. const axios = require('axios'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + let config = { method: 'get', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url', + url: apiUrl + '/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url', headers: { } }; diff --git a/JavaScript/Endpoint Examples/Multipart Payload/gif.js b/JavaScript/Endpoint Examples/Multipart Payload/gif.js index 49eb26f9..4f614d0b 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/gif.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/gif.js @@ -3,9 +3,17 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the file and parameters to it var data = new FormData(); -data.append('file', fs.createReadStream('/path/to/file')); +data.append('file', fs.createReadStream('/path/to/file')); data.append('pages', '1-last'); data.append('resolution', '300'); data.append('color_model', 'rgb'); @@ -15,8 +23,8 @@ data.append('output', 'pdfrest_gif'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/gif', - headers: { + url: apiUrl + '/gif', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -29,7 +37,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/jpg.js b/JavaScript/Endpoint Examples/Multipart Payload/jpg.js index 0692333c..7f559d1c 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/jpg.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/jpg.js @@ -3,9 +3,17 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the file and parameters to it var data = new FormData(); -data.append('file', fs.createReadStream('/path/to/file')); +data.append('file', fs.createReadStream('/path/to/file')); data.append('pages', '1-last'); data.append('resolution', '300'); data.append('color_model', 'rgb'); @@ -16,8 +24,8 @@ data.append('output', 'pdfrest_jpg'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/jpg', - headers: { + url: apiUrl + '/jpg', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -30,7 +38,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/linearized-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/linearized-pdf.js index ddd4e37b..93017402 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/linearized-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/linearized-pdf.js @@ -3,6 +3,14 @@ var FormData = require('form-data'); var fs = require('fs'); // This request demonstrates how to liearize a PDF for fast web viewing. +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -12,8 +20,8 @@ data.append('output', 'pdfrest_linearized_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/linearized-pdf', - headers: { + url: apiUrl + '/linearized-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -26,7 +34,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/markdown.js b/JavaScript/Endpoint Examples/Multipart Payload/markdown.js index eb0110b8..a30dfa6b 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/markdown.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/markdown.js @@ -3,6 +3,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -12,7 +20,7 @@ data.append("page_break_comments", "on"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/markdown", + url: apiUrl + "/markdown", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request @@ -27,4 +35,4 @@ axios(config) }) .catch(function (error) { console.log(error); - }); \ No newline at end of file + }); diff --git a/JavaScript/Endpoint Examples/Multipart Payload/merged-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/merged-pdf.js index f5e6473b..862d72a2 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/merged-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/merged-pdf.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -17,8 +25,8 @@ data.append('output', 'pdfrest_merged_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/merged-pdf', - headers: { + url: apiUrl + '/merged-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -31,7 +39,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-info.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-info.js index 8ba0477a..4825d4df 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-info.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-info.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -12,8 +20,8 @@ data.append('queries', 'tagged,image_only,title,subject,author,producer,creator, var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-info', - headers: { + url: apiUrl + '/pdf-info', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -26,7 +34,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-acroforms.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-acroforms.js index d36c3b2a..454e9eb4 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-acroforms.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-acroforms.js @@ -3,6 +3,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -12,7 +20,7 @@ data.append("output", "pdfrest_acroform_pdf"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/pdf-with-acroforms", + url: apiUrl + "/pdf-with-acroforms", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.js index 6b1e358b..5524d184 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.js @@ -5,6 +5,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -15,8 +23,8 @@ data.append('output', 'pdfrest_pdf_with_added_attachment'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-added-attachment', - headers: { + url: apiUrl + '/pdf-with-added-attachment', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -29,7 +37,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-image.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-image.js index e0a8c3f2..60133cf2 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-image.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-image.js @@ -5,6 +5,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -18,8 +26,8 @@ data.append('output', 'pdfrest_pdf_with_added_image'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-added-image', - headers: { + url: apiUrl + '/pdf-with-added-image', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -32,7 +40,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-text.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-text.js index 9165a14f..a4164996 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-text.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-added-text.js @@ -6,6 +6,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -30,8 +38,8 @@ data.append('output', 'pdfrest_pdf_with_added_text'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-added-text', - headers: { + url: apiUrl + '/pdf-with-added-text', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -44,7 +52,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.js index 8847195f..a84cbf4f 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -13,8 +21,8 @@ data.append('output', 'pdfrest_pdf_with_converted_colors'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-converted-colors', - headers: { + url: apiUrl + '/pdf-with-converted-colors', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -27,7 +35,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.js index 0cf78fa8..f35ed3a3 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -15,7 +23,7 @@ data.append("output", "pdfrest_pdf_with_imported_form_data"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/pdf-with-imported-form-data", + url: apiUrl + "/pdf-with-imported-form-data", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.js index 771c9cb3..9dfb9cf2 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -12,8 +20,8 @@ data.append('output', 'pdfrest_pdf-with-ocr-text'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-ocr-text', - headers: { + url: apiUrl + '/pdf-with-ocr-text', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -26,7 +34,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.js index b906ad9a..77f399de 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -31,7 +39,7 @@ data.append("output", "example_out"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/pdf-with-page-boxes-set", + url: apiUrl + "/pdf-with-page-boxes-set", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.js index a02d698a..3385f78f 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -15,8 +23,8 @@ data.append('output', 'pdfrest_pdf-with-redacted-text-applied'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-redacted-text-applied', - headers: { + url: apiUrl + '/pdf-with-redacted-text-applied', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -29,9 +37,9 @@ axios(config) console.log(JSON.stringify(response.data)); var output_id = response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -41,7 +49,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' @@ -56,7 +64,7 @@ axios(config) } }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.js index 13fcac8a..04790562 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.js @@ -6,6 +6,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -35,8 +43,8 @@ data.append('output', 'pdfrest_pdf_with_redacted_text_preview'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf-with-redacted-text-preview', - headers: { + url: apiUrl + '/pdf-with-redacted-text-preview', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -48,9 +56,9 @@ axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -63,7 +71,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' @@ -78,7 +86,7 @@ axios(config) } }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/pdf.js index 0bac6fe1..ead563d5 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdf.js @@ -2,20 +2,28 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); -data.append('compression', 'lossy'); -data.append('downsample', '300'); -data.append('tagged_pdf', 'off'); +data.append('compression', 'lossy'); +data.append('downsample', '300'); +data.append('tagged_pdf', 'off'); data.append('output', 'pdfrest_pdf'); // define configuration options for axios request var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdf', - headers: { + url: apiUrl + '/pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -28,7 +36,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdfa.js b/JavaScript/Endpoint Examples/Multipart Payload/pdfa.js index ddddd0cf..53c61faf 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdfa.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdfa.js @@ -1,12 +1,20 @@ -// This request demonstrates how to convert any of several formats to PDF/A. +// This request demonstrates how to convert any of several formats to PDF/A. var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data object and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); -data.append('output_type', 'PDF/A-2b'); +data.append('output_type', 'PDF/A-2b'); data.append('rasterize_if_errors_encountered', 'off'); data.append('output', 'pdfrest_pdfa'); @@ -14,8 +22,8 @@ data.append('output', 'pdfrest_pdfa'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdfa', - headers: { + url: apiUrl + '/pdfa', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -28,7 +36,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/pdfx.js b/JavaScript/Endpoint Examples/Multipart Payload/pdfx.js index a09bc7d8..4470d82e 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/pdfx.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/pdfx.js @@ -1,20 +1,28 @@ -// This request demonstrates how to convert any of several formats to PDF/X. +// This request demonstrates how to convert any of several formats to PDF/X. var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data object and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); -data.append('output_type', 'PDF/X-4'); +data.append('output_type', 'PDF/X-4'); data.append('output', 'pdfrest_pdfx'); // define configuration options for axios request var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/pdfx', - headers: { + url: apiUrl + '/pdfx', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -27,7 +35,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/png.js b/JavaScript/Endpoint Examples/Multipart Payload/png.js index e916b1b0..e580eead 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/png.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/png.js @@ -3,9 +3,17 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the file and parameters to it var data = new FormData(); -data.append('file', fs.createReadStream('/path/to/file')); +data.append('file', fs.createReadStream('/path/to/file')); data.append('pages', '1-last'); data.append('resolution', '300'); data.append('color_model', 'rgb'); @@ -15,8 +23,8 @@ data.append('output', 'pdfrest_png'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/png', - headers: { + url: apiUrl + '/png', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -29,8 +37,8 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/powerpoint.js b/JavaScript/Endpoint Examples/Multipart Payload/powerpoint.js index 96f65715..8e66d6af 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/powerpoint.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/powerpoint.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -12,8 +20,8 @@ data.append('output', 'pdfrest_powerpoint_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/powerpoint', - headers: { + url: apiUrl + '/powerpoint', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -26,7 +34,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/rasterized-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/rasterized-pdf.js index 454cfa9c..d0ee5e0d 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/rasterized-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/rasterized-pdf.js @@ -3,6 +3,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -12,7 +20,7 @@ data.append("output", "pdfrest_rasterized"); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/rasterized-pdf", + url: apiUrl + "/rasterized-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/request-status.js b/JavaScript/Endpoint Examples/Multipart Payload/request-status.js index 5bf214d1..e68d9976 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/request-status.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/request-status.js @@ -2,6 +2,14 @@ const axios = require("axios"); const FormData = require("form-data"); const fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + const apiKey = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // Replace with your API key const pathToFile = "/path/to/file.pdf"; @@ -18,7 +26,7 @@ const pollUntilFulfilled = async (requestId) => { const pollConfig = { method: "get", maxBodyLength: Infinity, // set maximum length of the request body - url: `https://api.pdfrest.com/request-status/${requestId}`, + url: `${apiUrl}/request-status/${requestId}`, headers: { "Api-Key": apiKey } }; requestStatusResponse = await axios(pollConfig); @@ -39,11 +47,11 @@ const demoApiPolling = async () => { // Send a request with the Response-Type header (using /bmp as an arbitrary example) const bmpRequestData = new FormData(); bmpRequestData.append("file", fs.createReadStream(pathToFile)); - + const bmpConfig = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/bmp", + url: apiUrl + "/bmp", headers: { "Api-Key": apiKey, "Response-Type": "requestId", // Use this header to get a request ID. @@ -53,7 +61,7 @@ const demoApiPolling = async () => { }; bmpResponse = await sendBmpReq(bmpConfig); console.log(JSON.stringify(bmpResponse.data)); - + // Get the request ID from the initial response. const requestId = bmpResponse.data.requestId; await pollUntilFulfilled(requestId); diff --git a/JavaScript/Endpoint Examples/Multipart Payload/restricted-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/restricted-pdf.js index bb98acb1..bac0d922 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/restricted-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/restricted-pdf.js @@ -3,6 +3,15 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -10,7 +19,7 @@ const DELETE_SENSITIVE_FILES = false; var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); data.append('new_permissions_password', 'new_example_pw'); -data.append('restrictions[]', 'print_low'); +data.append('restrictions[]', 'print_low'); data.append('restrictions[]', 'accessibility_off'); data.append('restrictions[]', 'edit_content'); data.append('output', 'pdfrest_restricted_pdf'); @@ -19,8 +28,8 @@ data.append('output', 'pdfrest_restricted_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/restricted-pdf', - headers: { + url: apiUrl + '/restricted-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // Set headers with form data headers }, @@ -33,9 +42,9 @@ axios(config) console.log(JSON.stringify(response.data)); var output_id = response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -45,7 +54,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' @@ -60,7 +69,7 @@ axios(config) } }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample diff --git a/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.js b/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.js index ab16c955..6710044c 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -28,7 +36,7 @@ data.append("output", "example_out"); var signed_pdf_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/signed-pdf", + url: apiUrl + "/signed-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf.js index 2aae08c6..5baf6b87 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/signed-pdf.js @@ -5,6 +5,15 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -35,7 +44,7 @@ data.append("output", "example_out"); var signed_pdf_config = { method: "post", maxBodyLength: Infinity, - url: "https://api.pdfrest.com/signed-pdf", + url: apiUrl + "/signed-pdf", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/split-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/split-pdf.js index bb863148..891a9f50 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/split-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/split-pdf.js @@ -6,6 +6,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -18,8 +26,8 @@ data.append('output', 'pdfrest_split_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/split-pdf', - headers: { + url: apiUrl + '/split-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -32,7 +40,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/tif.js b/JavaScript/Endpoint Examples/Multipart Payload/tif.js index 25f3f090..b4515e6f 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/tif.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/tif.js @@ -3,9 +3,17 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the file and parameters to it var data = new FormData(); -data.append('file', fs.createReadStream('/path/to/file')); +data.append('file', fs.createReadStream('/path/to/file')); data.append('pages', '1-last'); data.append('resolution', '300'); data.append('color_model', 'rgb'); @@ -15,8 +23,8 @@ data.append('output', 'pdfrest_tif'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/tif', - headers: { + url: apiUrl + '/tif', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -29,8 +37,8 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/unrestricted-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/unrestricted-pdf.js index 555225b1..070361d0 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/unrestricted-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/unrestricted-pdf.js @@ -6,6 +6,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -19,8 +27,8 @@ data.append('output', 'pdfrest_unrestricted_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/unrestricted-pdf', - headers: { + url: apiUrl + '/unrestricted-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -32,9 +40,9 @@ axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -45,7 +53,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' @@ -58,10 +66,10 @@ axios(config) .then(function (delete_response) { console.log(JSON.stringify(delete_response.data)); }) .catch(function (error) { console.log(error); }); } - + }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/unzip.js b/JavaScript/Endpoint Examples/Multipart Payload/unzip.js index 3d8a471c..59baaa6b 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/unzip.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/unzip.js @@ -5,6 +5,14 @@ var axios = require("axios"); var FormData = require("form-data"); var fs = require("fs"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -13,7 +21,7 @@ data.append("file", fs.createReadStream("/path/to/file")); var config = { method: "post", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/unzip", + url: apiUrl + "/unzip", headers: { "Api-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Replace with your API key ...data.getHeaders(), // set headers for the request diff --git a/JavaScript/Endpoint Examples/Multipart Payload/up-toolkit.js b/JavaScript/Endpoint Examples/Multipart Payload/up-toolkit.js index bb20131e..c7296c6e 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/up-toolkit.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/up-toolkit.js @@ -1,10 +1,18 @@ // This request demonstrates how to check the status of the API servers const axios = require("axios"); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + let config = { method: "get", maxBodyLength: Infinity, // set maximum length of the request body - url: "https://api.pdfrest.com/up-toolkit", // up-forms and up-office can be used to query the other tools + url: apiUrl + "/up-toolkit", // up-forms and up-office can be used to query the other tools headers: {}, }; diff --git a/JavaScript/Endpoint Examples/Multipart Payload/upload.js b/JavaScript/Endpoint Examples/Multipart Payload/upload.js index 84004161..a4fcb4ac 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/upload.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/upload.js @@ -3,6 +3,14 @@ var FormData = require('form-data'); var fs = require('fs'); // This request demonstrates how to upload a document to the service. +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data object and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); @@ -13,8 +21,8 @@ data.append("file", fs.createReadStream("/path/to/file")); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/upload', - headers: { + url: apiUrl + '/upload', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -27,5 +35,5 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); diff --git a/JavaScript/Endpoint Examples/Multipart Payload/watermarked-pdf.js b/JavaScript/Endpoint Examples/Multipart Payload/watermarked-pdf.js index 88ef9bf6..4d9de33a 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/watermarked-pdf.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/watermarked-pdf.js @@ -6,6 +6,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) const DELETE_SENSITIVE_FILES = false; @@ -26,8 +34,8 @@ data.append('output', 'pdfrest_watermarked_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/watermarked-pdf', - headers: { + url: apiUrl + '/watermarked-pdf', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -40,9 +48,9 @@ axios(config) console.log(JSON.stringify(response.data)); var output_id = response.data.outputId; - // All files uploaded or generated are automatically deleted based on the - // File Retention Period as shown on https://pdfrest.com/pricing. - // For immediate deletion of files, particularly when sensitive data + // All files uploaded or generated are automatically deleted based on the + // File Retention Period as shown on https://pdfrest.com/pricing. + // For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ axios(config) var delete_config = { method: 'post', maxBodyLength: Infinity, - url: 'https://api.pdfrest.com/delete', + url: apiUrl + '/delete', headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'Content-Type': 'application/json' @@ -67,7 +75,7 @@ axios(config) } }) .catch(function (error) { - console.log(error); + console.log(error); }); // If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/word.js b/JavaScript/Endpoint Examples/Multipart Payload/word.js index 56031221..f8b4133c 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/word.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/word.js @@ -3,6 +3,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -12,8 +20,8 @@ data.append('output', 'pdfrest_word_pdf'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/word', - headers: { + url: apiUrl + '/word', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -26,7 +34,7 @@ axios(config) console.log(JSON.stringify(response.data)); }) .catch(function (error) { - console.log(error); + console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/JavaScript/Endpoint Examples/Multipart Payload/zip.js b/JavaScript/Endpoint Examples/Multipart Payload/zip.js index a79e918d..5a8a1067 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/zip.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/zip.js @@ -6,6 +6,14 @@ var axios = require('axios'); var FormData = require('form-data'); var fs = require('fs'); +// By default, we use the US-based API service. This is the primary endpoint for global use. +var apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//var apiUrl = "https://eu-api.pdfrest.com"; + // Create a new form data instance and append the files and parameters to it var data = new FormData(); data.append('file', fs.createReadStream('/path/to/file')); @@ -16,8 +24,8 @@ data.append('output', 'pdfrest_zip'); var config = { method: 'post', maxBodyLength: Infinity, // set maximum length of the request body - url: 'https://api.pdfrest.com/zip', - headers: { + url: apiUrl + '/zip', + headers: { 'Api-Key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // Replace with your API key ...data.getHeaders() // set headers for the request }, @@ -33,4 +41,4 @@ axios(config) console.log(error); }); -// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. \ No newline at end of file +// If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.js' sample. diff --git a/PHP/Complex Flow Examples/decrypt-add-reencrypt.php b/PHP/Complex Flow Examples/decrypt-add-reencrypt.php index 6d689c79..1acade6d 100755 --- a/PHP/Complex Flow Examples/decrypt-add-reencrypt.php +++ b/PHP/Complex Flow Examples/decrypt-add-reencrypt.php @@ -15,6 +15,13 @@ * lock it up again. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; $client = new Client(); @@ -39,7 +46,7 @@ ] ]; -$decryptRequest = new Request('POST', 'https://api.pdfrest.com/decrypted-pdf', $headers); +$decryptRequest = new Request('POST', $apiUrl.'/decrypted-pdf', $headers); $decryptResponse = $client->sendAsync($decryptRequest, $decryptOptions)->wait(); @@ -79,7 +86,7 @@ ] ]; -$addImageRequest = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-image', $headers); +$addImageRequest = new Request('POST', $apiUrl.'/pdf-with-added-image', $headers); $addImageResponse = $client->sendAsync($addImageRequest, $addImageOptions)->wait(); @@ -105,7 +112,7 @@ ] ]; -$encryptRequest = new Request('POST', 'https://api.pdfrest.com/encrypted-pdf', $headers); +$encryptRequest = new Request('POST', $apiUrl.'/encrypted-pdf', $headers); $encryptResponse = $client->sendAsync($encryptRequest, $encryptOptions)->wait(); diff --git a/PHP/Complex Flow Examples/merge-different-file-types.php b/PHP/Complex Flow Examples/merge-different-file-types.php index f2306fd8..c35cb82a 100755 --- a/PHP/Complex Flow Examples/merge-different-file-types.php +++ b/PHP/Complex Flow Examples/merge-different-file-types.php @@ -18,6 +18,13 @@ * that the /pdf route takes as inputs. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; $client = new Client(); @@ -38,7 +45,7 @@ ] ]; -$imageToPDFRequest = new Request('POST', 'https://api.pdfrest.com/pdf', $headers); +$imageToPDFRequest = new Request('POST', $apiUrl.'/pdf', $headers); $imageToPDFResponse = $client->sendAsync($imageToPDFRequest, $imageToPDFOptions)->wait(); @@ -59,7 +66,7 @@ ] ]; -$powerpointToPDFRequest = new Request('POST', 'https://api.pdfrest.com/pdf', $headers); +$powerpointToPDFRequest = new Request('POST', $apiUrl.'/pdf', $headers); $powerpointToPDFResponse = $client->sendAsync($powerpointToPDFRequest, $powerpointToPDFOptions)->wait(); @@ -96,7 +103,7 @@ ] ]; -$mergeRequest = new Request('POST', 'https://api.pdfrest.com/merged-pdf', $headers); +$mergeRequest = new Request('POST', $apiUrl.'/merged-pdf', $headers); $mergeResponse = $client->sendAsync($mergeRequest, $mergeOptions)->wait(); diff --git a/PHP/Complex Flow Examples/ocr-with-extract-text.php b/PHP/Complex Flow Examples/ocr-with-extract-text.php index 4eb612b1..7072bc6e 100644 --- a/PHP/Complex Flow Examples/ocr-with-extract-text.php +++ b/PHP/Complex Flow Examples/ocr-with-extract-text.php @@ -15,6 +15,14 @@ * return the newly added text. */ + // By default, we use the US-based API service. This is the primary endpoint for global use. + $apiUrl = "https://api.pdfrest.com"; + + /* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ + //$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); $headers = [ @@ -39,7 +47,7 @@ ] ]; -$pdfToOCRRequest = new Request('POST', 'https://api.pdfrest.com/pdf-with-ocr-text', $headers); +$pdfToOCRRequest = new Request('POST', $apiUrl.'/pdf-with-ocr-text', $headers); echo "Sending POST request to OCR endpoint...\n"; $pdfToOCRResponse = $client->sendAsync($pdfToOCRRequest, $pdfToOCROptions)->wait(); @@ -59,7 +67,7 @@ ] ]; -$extractTextRequest = new Request('POST', 'https://api.pdfrest.com/extracted-text', $headers); +$extractTextRequest = new Request('POST', $apiUrl.'/extracted-text', $headers); echo "Sending POST request to extract text endpoint...\n"; $extractTextResponse = $client->sendAsync($extractTextRequest, $extractTextOptions)->wait(); @@ -69,4 +77,4 @@ $fullText = json_decode($extractTextResponse->getBody())->fullText; echo $fullText . "\n"; -?> \ No newline at end of file +?> diff --git a/PHP/Complex Flow Examples/pdfa-3b-with-attachment.php b/PHP/Complex Flow Examples/pdfa-3b-with-attachment.php index 14747c1b..40058e68 100755 --- a/PHP/Complex Flow Examples/pdfa-3b-with-attachment.php +++ b/PHP/Complex Flow Examples/pdfa-3b-with-attachment.php @@ -17,6 +17,14 @@ */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); $headers = [ @@ -44,7 +52,7 @@ ] ]; -$attachRequest = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-attachment', $headers); +$attachRequest = new Request('POST', $apiUrl.'/pdf-with-added-attachment', $headers); $attachResponse = $client->sendAsync($attachRequest, $attachOptions)->wait(); @@ -69,7 +77,7 @@ ] ]; -$pdfaRequest = new Request('POST', 'https://api.pdfrest.com/pdfa', $headers); +$pdfaRequest = new Request('POST', $apiUrl.'/pdfa', $headers); $pdfaResponse = $client->sendAsync($pdfaRequest, $pdfaOptions)->wait(); diff --git a/PHP/Complex Flow Examples/preserve-word-document.php b/PHP/Complex Flow Examples/preserve-word-document.php index 147baeae..63d16e24 100755 --- a/PHP/Complex Flow Examples/preserve-word-document.php +++ b/PHP/Complex Flow Examples/preserve-word-document.php @@ -13,6 +13,14 @@ * and convert it to the PDF/A format for long-term storage. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); @@ -33,7 +41,7 @@ ] ]; -$wordToPDFRequest = new Request('POST', 'https://api.pdfrest.com/pdf', $headers); +$wordToPDFRequest = new Request('POST', $apiUrl.'/pdf', $headers); $wordToPDFResponse = $client->sendAsync($wordToPDFRequest, $wordToPDFOptions)->wait(); @@ -58,7 +66,7 @@ ] ]; -$pdfaRequest = new Request('POST', 'https://api.pdfrest.com/pdfa', $headers); +$pdfaRequest = new Request('POST', $apiUrl.'/pdfa', $headers); $pdfaResponse = $client->sendAsync($pdfaRequest, $pdfaOptions)->wait(); diff --git a/PHP/Complex Flow Examples/protected-watermark.php b/PHP/Complex Flow Examples/protected-watermark.php index 8cbc9297..48369ee2 100755 --- a/PHP/Complex Flow Examples/protected-watermark.php +++ b/PHP/Complex Flow Examples/protected-watermark.php @@ -13,6 +13,14 @@ * and then /restricted-pdf to lock the watermark in. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); $headers = [ @@ -36,7 +44,7 @@ ] ]; -$watermarkRequest = new Request('POST', 'https://api.pdfrest.com/watermarked-pdf', $headers); +$watermarkRequest = new Request('POST', $apiUrl.'/watermarked-pdf', $headers); $watermarkResponse = $client->sendAsync($watermarkRequest, $watermarkOptions)->wait(); @@ -72,7 +80,7 @@ ] ]; -$restrictRequest = new Request('POST', 'https://api.pdfrest.com/restricted-pdf', $headers); +$restrictRequest = new Request('POST', $apiUrl.'/restricted-pdf', $headers); $restrictResponse = $client->sendAsync($restrictRequest, $restrictOptions)->wait(); diff --git a/PHP/Complex Flow Examples/redact-preview-and-finalize.php b/PHP/Complex Flow Examples/redact-preview-and-finalize.php index 6853c9bb..6a3c6c36 100644 --- a/PHP/Complex Flow Examples/redact-preview-and-finalize.php +++ b/PHP/Complex Flow Examples/redact-preview-and-finalize.php @@ -14,6 +14,14 @@ * redacted as intended. */ +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); @@ -38,7 +46,7 @@ ] ]; -$redactionPreviewRequest = new Request('POST', 'https://api.pdfrest.com/pdf-with-redacted-text-preview', $headers); +$redactionPreviewRequest = new Request('POST', $apiUrl.'/pdf-with-redacted-text-preview', $headers); $redactionPreviewResponse = $client->sendAsync($redactionPreviewRequest, $redactionPreviewOptions)->wait(); @@ -59,7 +67,7 @@ ] ]; -$redactionAppliedRequest = new Request('POST', 'https://api.pdfrest.com/pdf-with-redacted-text-applied', $headers); +$redactionAppliedRequest = new Request('POST', $apiUrl.'/pdf-with-redacted-text-applied', $headers); $redactionAppliedResponse = $client->sendAsync($redactionAppliedRequest, $redactionAppliedOptions)->wait(); diff --git a/PHP/Endpoint Examples/JSON Payload/batch-delete.php b/PHP/Endpoint Examples/JSON Payload/batch-delete.php index f54155ba..55ae46f8 100644 --- a/PHP/Endpoint Examples/JSON Payload/batch-delete.php +++ b/PHP/Endpoint Examples/JSON Payload/batch-delete.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $delete_client = new Client(['http_errors' => false]); $delete_headers = [ @@ -12,6 +20,6 @@ 'Content-Type' => 'application/json' ]; $delete_body = '{"ids":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}'; -$delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); +$delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/bmp.php b/PHP/Endpoint Examples/JSON Payload/bmp.php index 764b2430..e809e8e6 100644 --- a/PHP/Endpoint Examples/JSON Payload/bmp.php +++ b/PHP/Endpoint Examples/JSON Payload/bmp.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $bmp_body = '{"id":"'.$uploaded_id.'"}'; -$bmp_request = new Request('POST', 'https://api.pdfrest.com/bmp', $bmp_headers, $bmp_body); +$bmp_request = new Request('POST', $apiUrl.'/bmp', $bmp_headers, $bmp_body); $bmp_res = $bmp_client->sendAsync($bmp_request)->wait(); echo $bmp_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/compressed-pdf.php b/PHP/Endpoint Examples/JSON Payload/compressed-pdf.php index 2449cb78..2cff153f 100644 --- a/PHP/Endpoint Examples/JSON Payload/compressed-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/compressed-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $compress_body = '{"id":"'.$uploaded_id.'", "compression_level": "medium"}'; -$compress_request = new Request('POST', 'https://api.pdfrest.com/compressed-pdf', $compress_headers, $compress_body); +$compress_request = new Request('POST', $apiUrl.'/compressed-pdf', $compress_headers, $compress_body); $compress_res = $compress_client->sendAsync($compress_request)->wait(); echo $compress_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/decrypted-pdf.php b/PHP/Endpoint Examples/JSON Payload/decrypted-pdf.php index b1a57861..04110eb9 100644 --- a/PHP/Endpoint Examples/JSON Payload/decrypted-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/decrypted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -31,14 +39,14 @@ 'Content-Type' => 'application/json' ]; $decrypt_body = '{"id":"'.$uploaded_id.'", "current_open_password": "password"}'; -$decrypt_request = new Request('POST', 'https://api.pdfrest.com/decrypted-pdf', $decrypt_headers, $decrypt_body); +$decrypt_request = new Request('POST', $apiUrl.'/decrypted-pdf', $decrypt_headers, $decrypt_body); $decrypt_res = $decrypt_client->sendAsync($decrypt_request)->wait(); $decrypt_body = (string) $decrypt_res->getBody(); echo $decrypt_body . PHP_EOL; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -51,7 +59,7 @@ ]; $decrypt_json = json_decode($decrypt_body, true); $delete_body = '{"ids":"'.$uploaded_id.', '.$decrypt_json['outputId'].'"}'; - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/delete-resource.php b/PHP/Endpoint Examples/JSON Payload/delete-resource.php index 0ff24cff..19a3c455 100644 --- a/PHP/Endpoint Examples/JSON Payload/delete-resource.php +++ b/PHP/Endpoint Examples/JSON Payload/delete-resource.php @@ -2,8 +2,16 @@ $curl = curl_init(); +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + curl_setopt_array($curl, array( - CURLOPT_URL => 'https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + CURLOPT_URL => $apiUrl.'/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, diff --git a/PHP/Endpoint Examples/JSON Payload/encrypted-pdf.php b/PHP/Endpoint Examples/JSON Payload/encrypted-pdf.php index d45cf5e5..770fb14b 100644 --- a/PHP/Endpoint Examples/JSON Payload/encrypted-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/encrypted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -31,16 +39,16 @@ 'Content-Type' => 'application/json' ]; $encrypt_body = '{"id":"'.$uploaded_id.'", "new_open_password": "password"}'; -$encrypt_request = new Request('POST', 'https://api.pdfrest.com/encrypted-pdf', $encrypt_headers, $encrypt_body); +$encrypt_request = new Request('POST', $apiUrl.'/encrypted-pdf', $encrypt_headers, $encrypt_body); $encrypt_res = $encrypt_client->sendAsync($encrypt_request)->wait(); $encrypt_body_str = (string)$encrypt_res->getBody(); echo $encrypt_body_str . PHP_EOL; $encrypt_response_json = json_decode($encrypt_body_str); $output_id = $encrypt_response_json->{'outputId'} ?? ''; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ 'Content-Type' => 'application/json' ]; $delete_body = '{"ids":"' . $uploaded_id . ', ' . $output_id . '"}'; - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/excel.php b/PHP/Endpoint Examples/JSON Payload/excel.php index 86620153..fb555fbd 100644 --- a/PHP/Endpoint Examples/JSON Payload/excel.php +++ b/PHP/Endpoint Examples/JSON Payload/excel.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $excel_body = '{"id":"'.$uploaded_id.'"}'; -$excel_request = new Request('POST', 'https://api.pdfrest.com/excel', $excel_headers, $excel_body); +$excel_request = new Request('POST', $apiUrl.'/excel', $excel_headers, $excel_body); $excel_res = $excel_client->sendAsync($excel_request)->wait(); echo $excel_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/exported-form-data.php b/PHP/Endpoint Examples/JSON Payload/exported-form-data.php index 099cc5b8..a51d3b90 100644 --- a/PHP/Endpoint Examples/JSON Payload/exported-form-data.php +++ b/PHP/Endpoint Examples/JSON Payload/exported-form-data.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $export_body = '{"id":"'.$uploaded_id.'", "data_format": "xml"}'; -$export_request = new Request('POST', 'https://api.pdfrest.com/exported-form-data', $export_headers, $export_body); +$export_request = new Request('POST', $apiUrl.'/exported-form-data', $export_headers, $export_body); $export_res = $export_client->sendAsync($export_request)->wait(); echo $export_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/extracted-images.php b/PHP/Endpoint Examples/JSON Payload/extracted-images.php index f65fda18..588b0f18 100644 --- a/PHP/Endpoint Examples/JSON Payload/extracted-images.php +++ b/PHP/Endpoint Examples/JSON Payload/extracted-images.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $extract_body = '{"id":"'.$uploaded_id.'", "pages": "1-last"}'; -$extract_request = new Request('POST', 'https://api.pdfrest.com/extracted-images', $extract_headers, $extract_body); +$extract_request = new Request('POST', $apiUrl.'/extracted-images', $extract_headers, $extract_body); $extract_res = $extract_client->sendAsync($extract_request)->wait(); echo $extract_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/extracted-text.php b/PHP/Endpoint Examples/JSON Payload/extracted-text.php index e684872d..9f694ea2 100644 --- a/PHP/Endpoint Examples/JSON Payload/extracted-text.php +++ b/PHP/Endpoint Examples/JSON Payload/extracted-text.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $extract_body = '{"id":"'.$uploaded_id.'"}'; -$extract_request = new Request('POST', 'https://api.pdfrest.com/extracted-text', $extract_headers, $extract_body); +$extract_request = new Request('POST', $apiUrl.'/extracted-text', $extract_headers, $extract_body); $extract_res = $extract_client->sendAsync($extract_request)->wait(); echo $extract_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/flattened-annotations-pdf.php b/PHP/Endpoint Examples/JSON Payload/flattened-annotations-pdf.php index b4441adc..f02424d2 100644 --- a/PHP/Endpoint Examples/JSON Payload/flattened-annotations-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/flattened-annotations-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $flatten_body = '{"id":"'.$uploaded_id.'"}'; -$flatten_request = new Request('POST', 'https://api.pdfrest.com/flattened-annotations-pdf', $flatten_headers, $flatten_body); +$flatten_request = new Request('POST', $apiUrl.'/flattened-annotations-pdf', $flatten_headers, $flatten_body); $flatten_res = $flatten_client->sendAsync($flatten_request)->wait(); echo $flatten_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/flattened-forms-pdf.php b/PHP/Endpoint Examples/JSON Payload/flattened-forms-pdf.php index b7aea94a..5a355b85 100644 --- a/PHP/Endpoint Examples/JSON Payload/flattened-forms-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/flattened-forms-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $flatten_body = '{"id":"'.$uploaded_id.'"}'; -$flatten_request = new Request('POST', 'https://api.pdfrest.com/flattened-forms-pdf', $flatten_headers, $flatten_body); +$flatten_request = new Request('POST', $apiUrl.'/flattened-forms-pdf', $flatten_headers, $flatten_body); $flatten_res = $flatten_client->sendAsync($flatten_request)->wait(); echo $flatten_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/flattened-layers-pdf.php b/PHP/Endpoint Examples/JSON Payload/flattened-layers-pdf.php index 7394c29e..1940517e 100644 --- a/PHP/Endpoint Examples/JSON Payload/flattened-layers-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/flattened-layers-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $flatten_body = '{"id":"'.$uploaded_id.'"}'; -$flatten_request = new Request('POST', 'https://api.pdfrest.com/flattened-layers-pdf', $flatten_headers, $flatten_body); +$flatten_request = new Request('POST', $apiUrl.'/flattened-layers-pdf', $flatten_headers, $flatten_body); $flatten_res = $flatten_client->sendAsync($flatten_request)->wait(); echo $flatten_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.php b/PHP/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.php index feef0a0f..50ef08f2 100644 --- a/PHP/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $flatten_body = '{"id":"'.$uploaded_id.'"}'; -$flatten_request = new Request('POST', 'https://api.pdfrest.com/flattened-transparencies-pdf', $flatten_headers, $flatten_body); +$flatten_request = new Request('POST', $apiUrl.'/flattened-transparencies-pdf', $flatten_headers, $flatten_body); $flatten_res = $flatten_client->sendAsync($flatten_request)->wait(); echo $flatten_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/get-resource.php b/PHP/Endpoint Examples/JSON Payload/get-resource.php index 3d1f1f74..47397ac7 100644 --- a/PHP/Endpoint Examples/JSON Payload/get-resource.php +++ b/PHP/Endpoint Examples/JSON Payload/get-resource.php @@ -1,13 +1,23 @@ false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $gif_body = '{"id":"'.$uploaded_id.'"}'; -$gif_request = new Request('POST', 'https://api.pdfrest.com/gif', $gif_headers, $gif_body); +$gif_request = new Request('POST', $apiUrl.'/gif', $gif_headers, $gif_body); $gif_res = $gif_client->sendAsync($gif_request)->wait(); echo $gif_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/jpg.php b/PHP/Endpoint Examples/JSON Payload/jpg.php index ba9fb877..53b2fdb1 100644 --- a/PHP/Endpoint Examples/JSON Payload/jpg.php +++ b/PHP/Endpoint Examples/JSON Payload/jpg.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $jpg_body = '{"id":"'.$uploaded_id.'"}'; -$jpg_request = new Request('POST', 'https://api.pdfrest.com/jpg', $jpg_headers, $jpg_body); +$jpg_request = new Request('POST', $apiUrl.'/jpg', $jpg_headers, $jpg_body); $jpg_res = $jpg_client->sendAsync($jpg_request)->wait(); echo $jpg_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/linearized-pdf.php b/PHP/Endpoint Examples/JSON Payload/linearized-pdf.php index b093a40d..b4917be3 100644 --- a/PHP/Endpoint Examples/JSON Payload/linearized-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/linearized-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $linearize_body = '{"id":"'.$uploaded_id.'"}'; -$linearize_request = new Request('POST', 'https://api.pdfrest.com/linearized-pdf', $linearize_headers, $linearize_body); +$linearize_request = new Request('POST', $apiUrl.'/linearized-pdf', $linearize_headers, $linearize_body); $linearize_res = $linearize_client->sendAsync($linearize_request)->wait(); echo $linearize_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/markdown.php b/PHP/Endpoint Examples/JSON Payload/markdown.php index 914edb91..a1183e43 100644 --- a/PHP/Endpoint Examples/JSON Payload/markdown.php +++ b/PHP/Endpoint Examples/JSON Payload/markdown.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $markdown_body = '{"id":"'.$uploaded_id.'","page_break_comments":"on"}'; -$markdown_request = new Request('POST', 'https://api.pdfrest.com/markdown', $markdown_headers, $markdown_body); +$markdown_request = new Request('POST', $apiUrl.'/markdown', $markdown_headers, $markdown_body); $markdown_res = $markdown_client->sendAsync($markdown_request)->wait(); -echo $markdown_res->getBody() . PHP_EOL; \ No newline at end of file +echo $markdown_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/merged-pdf.php b/PHP/Endpoint Examples/JSON Payload/merged-pdf.php index 3a84d45c..a12383b3 100644 --- a/PHP/Endpoint Examples/JSON Payload/merged-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/merged-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_first_file_client = new Client(['http_errors' => false]); $upload_first_file_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_first_file_body = file_get_contents('/path/to/first_file'); -$upload_first_file_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_first_file_headers, $upload_first_file_body); +$upload_first_file_request = new Request('POST', $apiUrl.'/upload', $upload_first_file_headers, $upload_first_file_body); $upload_first_file_res = $upload_first_file_client->sendAsync($upload_first_file_request)->wait(); echo $upload_first_file_res->getBody() . PHP_EOL; @@ -30,7 +38,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_second_file_body = file_get_contents('/path/to/second_file'); -$upload_second_file_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_second_file_headers, $upload_second_file_body); +$upload_second_file_request = new Request('POST', $apiUrl.'/upload', $upload_second_file_headers, $upload_second_file_body); $upload_second_file_res = $upload_second_file_client->sendAsync($upload_second_file_request)->wait(); echo $upload_second_file_res->getBody() . PHP_EOL; @@ -48,6 +56,6 @@ 'Content-Type' => 'application/json' ]; $merge_body = '{"id":["'.$uploaded_first_file_id.'", "'.$uploaded_second_file_id.'"], "type":["id","id"], "pages": [1,1]}'; -$merge_request = new Request('POST', 'https://api.pdfrest.com/merged-pdf', $merge_headers, $merge_body); +$merge_request = new Request('POST', $apiUrl.'/merged-pdf', $merge_headers, $merge_body); $merge_res = $merge_client->sendAsync($merge_request)->wait(); echo $merge_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-info.php b/PHP/Endpoint Examples/JSON Payload/pdf-info.php index e4f0ac14..8b9fa4e6 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-info.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-info.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $info_body = '{"id":"'.$uploaded_id.'", "queries":"title,page_count"}'; -$info_request = new Request('POST', 'https://api.pdfrest.com/pdf-info', $info_headers, $info_body); +$info_request = new Request('POST', $apiUrl.'/pdf-info', $info_headers, $info_body); $info_res = $info_client->sendAsync($info_request)->wait(); echo $info_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-acroforms.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-acroforms.php index 4fcd3333..5c641b73 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-acroforms.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-acroforms.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $acroform_body = '{"id":"'.$uploaded_id.'"}'; -$acroform_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-acroforms', $acroform_headers, $acroform_body); +$acroform_request = new Request('POST', $apiUrl.'/pdf-with-acroforms', $acroform_headers, $acroform_body); $acroform_res = $acroform_client->sendAsync($acroform_request)->wait(); echo $acroform_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-added-attachment.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-added-attachment.php index 557741ca..83ab3009 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-added-attachment.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-added-attachment.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_pdf_client = new Client(['http_errors' => false]); $upload_pdf_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_pdf_body = file_get_contents('/path/to/pdf_file'); -$upload_pdf_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_pdf_headers, $upload_pdf_body); +$upload_pdf_request = new Request('POST', $apiUrl.'/upload', $upload_pdf_headers, $upload_pdf_body); $upload_pdf_res = $upload_pdf_client->sendAsync($upload_pdf_request)->wait(); echo $upload_pdf_res->getBody() . PHP_EOL; @@ -30,7 +38,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_attachment_body = file_get_contents('/path/to/attachment_file'); -$upload_attachment_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_attachment_headers, $upload_attachment_body); +$upload_attachment_request = new Request('POST', $apiUrl.'/upload', $upload_attachment_headers, $upload_attachment_body); $upload_attachment_res = $upload_attachment_client->sendAsync($upload_attachment_request)->wait(); echo $upload_attachment_res->getBody() . PHP_EOL; @@ -48,6 +56,6 @@ 'Content-Type' => 'application/json' ]; $add_attachment_body = '{"id":"'.$uploaded_pdf_id.'", "id_to_attach": "'.$uploaded_attachment_id.'"}'; -$add_attachment_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-attachment', $add_attachment_headers, $add_attachment_body); +$add_attachment_request = new Request('POST', $apiUrl.'/pdf-with-added-attachment', $add_attachment_headers, $add_attachment_body); $add_attachment_res = $add_attachment_client->sendAsync($add_attachment_request)->wait(); echo $add_attachment_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-added-image.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-added-image.php index f4a32310..32f68c6f 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-added-image.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-added-image.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_pdf_client = new Client(['http_errors' => false]); $upload_pdf_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_pdf_body = file_get_contents('/path/to/pdf_file'); -$upload_pdf_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_pdf_headers, $upload_pdf_body); +$upload_pdf_request = new Request('POST', $apiUrl.'/upload', $upload_pdf_headers, $upload_pdf_body); $upload_pdf_res = $upload_pdf_client->sendAsync($upload_pdf_request)->wait(); echo $upload_pdf_res->getBody() . PHP_EOL; @@ -30,7 +38,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_image_body = file_get_contents('/path/to/image_file); -$upload_image_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_image_headers, $upload_image_body); +$upload_image_request = new Request('POST', $apiUrl.'/upload', $upload_image_headers, $upload_image_body); $upload_image_res = $upload_image_client->sendAsync($upload_image_request)->wait(); echo $upload_image_res->getBody() . PHP_EOL; @@ -48,6 +56,6 @@ 'Content-Type' => 'application/json' ]; $add_image_body = '{"id":"'.$uploaded_pdf_id.'", "image_id": "'.$uploaded_image_id.'", "x":0, "y":0, "page":1}'; -$add_image_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-image', $add_image_headers, $add_image_body); +$add_image_request = new Request('POST', $apiUrl.'/pdf-with-added-image', $add_image_headers, $add_image_body); $add_image_res = $add_image_client->sendAsync($add_image_request)->wait(); echo $add_image_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-added-text.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-added-text.php index 5528f830..28690aaf 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-added-text.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-added-text.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -29,6 +37,6 @@ 'Content-Type' => 'application/json' ]; $add_text_body = '{"id":"'.$uploaded_id.'", "text_objects":"'.$text_options.'"}'; -$add_text_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-text', $add_text_headers, $add_text_body); +$add_text_request = new Request('POST', $apiUrl.'/pdf-with-added-text', $add_text_headers, $add_text_body); $add_text_res = $add_text_client->sendAsync($add_text_request)->wait(); echo $add_text_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-converted-colors.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-converted-colors.php index b171b0de..c8122a74 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-converted-colors.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-converted-colors.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $convert_colors_body = '{"id":"'.$uploaded_id.'", "color_profile": "srgb"}'; -$convert_colors_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-converted-colors', $convert_colors_headers, $convert_colors_body); +$convert_colors_request = new Request('POST', $apiUrl.'/pdf-with-converted-colors', $convert_colors_headers, $convert_colors_body); $convert_colors_res = $convert_colors_client->sendAsync($convert_colors_request)->wait(); echo $convert_colors_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.php index 0bbe9462..585852cd 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_pdf_client = new Client(['http_errors' => false]); $upload_pdf_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_pdf_body = file_get_contents('/path/to/pdf_file'); -$upload_pdf_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_pdf_headers, $upload_pdf_body); +$upload_pdf_request = new Request('POST', $apiUrl.'/upload', $upload_pdf_headers, $upload_pdf_body); $upload_pdf_res = $upload_pdf_client->sendAsync($upload_pdf_request)->wait(); echo $upload_pdf_res->getBody() . PHP_EOL; @@ -30,7 +38,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_data_body = file_get_contents('/path/to/data_file'); -$upload_data_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_data_headers, $upload_data_body); +$upload_data_request = new Request('POST', $apiUrl.'/upload', $upload_data_headers, $upload_data_body); $upload_data_res = $upload_data_client->sendAsync($upload_data_request)->wait(); echo $upload_data_res->getBody() . PHP_EOL; @@ -48,6 +56,6 @@ 'Content-Type' => 'application/json' ]; $import_data_body = '{"id":"'.$uploaded_pdf_id.'", "data_file_id": "'.$uploaded_data_id.'"}'; -$import_data_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-imported-form-data', $import_data_headers, $import_data_body); +$import_data_request = new Request('POST', $apiUrl.'/pdf-with-imported-form-data', $import_data_headers, $import_data_body); $import_data_res = $import_data_client->sendAsync($import_data_request)->wait(); echo $import_data_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-ocr-text.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-ocr-text.php index 971ee057..fe707093 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-ocr-text.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-ocr-text.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $pdf_with_ocr_text_body = '{"id":"'.$uploaded_id.'"}'; -$pdf_with_ocr_text_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-ocr-text', $pdf_with_ocr_text_headers, $pdf_with_ocr_text_body); +$pdf_with_ocr_text_request = new Request('POST', $apiUrl.'/pdf-with-ocr-text', $pdf_with_ocr_text_headers, $pdf_with_ocr_text_body); $pdf_with_ocr_text_res = $pdf_with_ocr_text_client->sendAsync($pdf_with_ocr_text_request)->wait(); echo $pdf_with_ocr_text_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.php index 0c347afd..ea50105c 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -29,6 +37,6 @@ 'Content-Type' => 'application/json' ]; $boxes_body = '{"id":"'.$uploaded_id.'", "boxes":"'.$box_options.'"}'; -$boxes_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-page-boxes-set', $boxes_headers, $boxes_body); +$boxes_request = new Request('POST', $apiUrl.'/pdf-with-page-boxes-set', $boxes_headers, $boxes_body); $boxes_res = $boxes_client->sendAsync($boxes_request)->wait(); echo $boxes_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.php index 77a08a99..78089ce5 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -31,16 +39,16 @@ 'Content-Type' => 'application/json' ]; $pdf_with_redacted_text_body = '{"id":"'.$uploaded_id.'"}'; -$pdf_with_redacted_text_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-redacted-text-applied', $pdf_with_redacted_text_headers, $pdf_with_redacted_text_body); +$pdf_with_redacted_text_request = new Request('POST', $apiUrl.'/pdf-with-redacted-text-applied', $pdf_with_redacted_text_headers, $pdf_with_redacted_text_body); $pdf_with_redacted_text_res = $pdf_with_redacted_text_client->sendAsync($pdf_with_redacted_text_request)->wait(); $applied_body_str = (string)$pdf_with_redacted_text_res->getBody(); echo $applied_body_str . PHP_EOL; $applied_response_json = json_decode($applied_body_str); $output_id = $applied_response_json->{'outputId'} ?? ''; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ 'Content-Type' => 'application/json' ]; $delete_body = '{"ids":"' . $uploaded_id . ', ' . $output_id . '"}'; - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.php b/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.php index 2ce866f1..cbf0d3e7 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -32,14 +40,14 @@ 'Content-Type' => 'application/json' ]; $redact_text_body = '{"id":"'.$uploaded_id.'", "redactions":"'.$redaction_options.'"}'; -$redact_text_request = new Request('POST', 'https://api.pdfrest.com/pdf-with-redacted-text-preview', $redact_text_headers, $redact_text_body); +$redact_text_request = new Request('POST', $apiUrl.'/pdf-with-redacted-text-preview', $redact_text_headers, $redact_text_body); $redact_text_res = $redact_text_client->sendAsync($redact_text_request)->wait(); $preview_body_str = (string)$redact_text_res->getBody(); echo $preview_body_str . PHP_EOL; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -55,7 +63,7 @@ $preview_json = json_decode($preview_body_str, true); $preview_id = isset($preview_json['outputId']) ? $preview_json['outputId'] : ''; $delete_body = json_encode([ 'ids' => $uploaded_id . ', ' . $preview_id ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/pdf.php b/PHP/Endpoint Examples/JSON Payload/pdf.php index 03200e87..76c5828f 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $pdf_body = '{"id":"'.$uploaded_id.'"}'; -$pdf_request = new Request('POST', 'https://api.pdfrest.com/pdf', $pdf_headers, $pdf_body); +$pdf_request = new Request('POST', $apiUrl.'/pdf', $pdf_headers, $pdf_body); $pdf_res = $pdf_client->sendAsync($pdf_request)->wait(); echo $pdf_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdfa.php b/PHP/Endpoint Examples/JSON Payload/pdfa.php index ca52948f..dbb5fbb0 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdfa.php +++ b/PHP/Endpoint Examples/JSON Payload/pdfa.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $pdfa_body = '{"id":"'.$uploaded_id.'", "output_type":"PDF/A-2b"}'; -$pdfa_request = new Request('POST', 'https://api.pdfrest.com/pdfa', $pdfa_headers, $pdfa_body); +$pdfa_request = new Request('POST', $apiUrl.'/pdfa', $pdfa_headers, $pdfa_body); $pdfa_res = $pdfa_client->sendAsync($pdfa_request)->wait(); echo $pdfa_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/pdfx.php b/PHP/Endpoint Examples/JSON Payload/pdfx.php index e8094b4a..b8ee332a 100644 --- a/PHP/Endpoint Examples/JSON Payload/pdfx.php +++ b/PHP/Endpoint Examples/JSON Payload/pdfx.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $pdfx_body = '{"id":"'.$uploaded_id.'", "output_type":"PDF/X-1a"}'; -$pdfx_request = new Request('POST', 'https://api.pdfrest.com/pdfx', $pdfx_headers, $pdfx_body); +$pdfx_request = new Request('POST', $apiUrl.'/pdfx', $pdfx_headers, $pdfx_body); $pdfx_res = $pdfx_client->sendAsync($pdfx_request)->wait(); echo $pdfx_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/png.php b/PHP/Endpoint Examples/JSON Payload/png.php index a6089fd7..3b57d02f 100644 --- a/PHP/Endpoint Examples/JSON Payload/png.php +++ b/PHP/Endpoint Examples/JSON Payload/png.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $png_body = '{"id":"'.$uploaded_id.'"}'; -$png_request = new Request('POST', 'https://api.pdfrest.com/png', $png_headers, $png_body); +$png_request = new Request('POST', $apiUrl.'/png', $png_headers, $png_body); $png_res = $png_client->sendAsync($png_request)->wait(); echo $png_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/powerpoint.php b/PHP/Endpoint Examples/JSON Payload/powerpoint.php index da16c5db..78d671d8 100644 --- a/PHP/Endpoint Examples/JSON Payload/powerpoint.php +++ b/PHP/Endpoint Examples/JSON Payload/powerpoint.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $powerpoint_body = '{"id":"'.$uploaded_id.'"}'; -$powerpoint_request = new Request('POST', 'https://api.pdfrest.com/powerpoint', $powerpoint_headers, $powerpoint_body); +$powerpoint_request = new Request('POST', $apiUrl.'/powerpoint', $powerpoint_headers, $powerpoint_body); $powerpoint_res = $powerpoint_client->sendAsync($powerpoint_request)->wait(); echo $powerpoint_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/rasterized-pdf.php b/PHP/Endpoint Examples/JSON Payload/rasterized-pdf.php index 1db075fb..25b99c97 100644 --- a/PHP/Endpoint Examples/JSON Payload/rasterized-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/rasterized-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $rasterize_body = '{"id":"'.$uploaded_id.'"}'; -$rasterize_request = new Request('POST', 'https://api.pdfrest.com/rasterized-pdf', $rasterize_headers, $rasterize_body); +$rasterize_request = new Request('POST', $apiUrl.'/rasterized-pdf', $rasterize_headers, $rasterize_body); $rasterize_res = $rasterize_client->sendAsync($rasterize_request)->wait(); echo $rasterize_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/restricted-pdf.php b/PHP/Endpoint Examples/JSON Payload/restricted-pdf.php index 53b2e01b..b1cd3fd9 100644 --- a/PHP/Endpoint Examples/JSON Payload/restricted-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/restricted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -31,16 +39,16 @@ 'Content-Type' => 'application/json' ]; $restrict_body = '{"id":"'.$uploaded_id.'", "new_permissions_password":"password"}'; -$restrict_request = new Request('POST', 'https://api.pdfrest.com/restricted-pdf', $restrict_headers, $restrict_body); +$restrict_request = new Request('POST', $apiUrl.'/restricted-pdf', $restrict_headers, $restrict_body); $restrict_res = $restrict_client->sendAsync($restrict_request)->wait(); $restrict_body_str = (string)$restrict_res->getBody(); echo $restrict_body_str . PHP_EOL; $restrict_response_json = json_decode($restrict_body_str); $output_id = $restrict_response_json->{'outputId'} ?? ''; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ 'Content-Type' => 'application/json' ]; $delete_body = '{"ids":"' . $uploaded_id . ', ' . $output_id . '"}'; - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.php b/PHP/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.php index 64c4432f..1bddfc7f 100644 --- a/PHP/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.php +++ b/PHP/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $input_upload_headers = [ 'api-key' => 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $input_upload_body = file_get_contents('/path/to/file'); -$input_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $input_upload_headers, $input_upload_body); +$input_upload_request = new Request('POST', $apiUrl.'/upload', $input_upload_headers, $input_upload_body); $input_upload_res = $upload_client->sendAsync($input_upload_request)->wait(); echo $input_upload_res->getBody() . PHP_EOL; @@ -28,7 +36,7 @@ 'Content-Type' => 'application/octet-stream' ]; $certificate_upload_body = file_get_contents('/path/to/file'); -$certificate_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $certificate_upload_headers, $certificate_upload_body); +$certificate_upload_request = new Request('POST', $apiUrl.'/upload', $certificate_upload_headers, $certificate_upload_body); $certificate_upload_res = $upload_client->sendAsync($certificate_upload_request)->wait(); echo $certificate_upload_res->getBody() . PHP_EOL; @@ -44,7 +52,7 @@ 'Content-Type' => 'application/octet-stream' ]; $private_key_upload_body = file_get_contents('/path/to/file'); -$private_key_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $private_key_upload_headers, $private_key_upload_body); +$private_key_upload_request = new Request('POST', $apiUrl.'/upload', $private_key_upload_headers, $private_key_upload_body); $private_key_upload_res = $upload_client->sendAsync($private_key_upload_request)->wait(); echo $private_key_upload_res->getBody() . PHP_EOL; @@ -61,6 +69,6 @@ 'Content-Type' => 'application/json' ]; $signing_body = '{"id":"'.$uploaded_input_id.'", "certificate_id":"'.$uploaded_certificate_id.'", "private_key_id":"'.$uploaded_private_key_id.'", "signature_configuration":"'.$signature_config.'"}'; -$signing_request = new Request('POST', 'https://api.pdfrest.com/signed-pdf', $signing_headers, $signing_body); +$signing_request = new Request('POST', $apiUrl.'/signed-pdf', $signing_headers, $signing_body); $signing_res = $signing_client->sendAsync($signing_request)->wait(); echo $signing_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/signed-pdf.php b/PHP/Endpoint Examples/JSON Payload/signed-pdf.php index 9cff80e8..025be30c 100644 --- a/PHP/Endpoint Examples/JSON Payload/signed-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/signed-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $input_upload_headers = [ 'api-key' => 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $input_upload_body = file_get_contents('/path/to/file'); -$input_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $input_upload_headers, $input_upload_body); +$input_upload_request = new Request('POST', $apiUrl.'/upload', $input_upload_headers, $input_upload_body); $input_upload_res = $upload_client->sendAsync($input_upload_request)->wait(); echo $input_upload_res->getBody() . PHP_EOL; @@ -28,7 +36,7 @@ 'Content-Type' => 'application/octet-stream' ]; $credentials_upload_body = file_get_contents('/path/to/file'); -$credentials_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $credentials_upload_headers, $credentials_upload_body); +$credentials_upload_request = new Request('POST', $apiUrl.'/upload', $credentials_upload_headers, $credentials_upload_body); $credentials_upload_res = $upload_client->sendAsync($credentials_upload_request)->wait(); echo $credentials_upload_res->getBody() . PHP_EOL; @@ -44,7 +52,7 @@ 'Content-Type' => 'application/octet-stream' ]; $passphrase_upload_body = file_get_contents('/path/to/file'); -$passphrase_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $passphrase_upload_headers, $passphrase_upload_body); +$passphrase_upload_request = new Request('POST', $apiUrl.'/upload', $passphrase_upload_headers, $passphrase_upload_body); $passphrase_upload_res = $upload_client->sendAsync($passphrase_upload_request)->wait(); echo $passphrase_upload_res->getBody() . PHP_EOL; @@ -60,7 +68,7 @@ 'Content-Type' => 'application/octet-stream' ]; $logo_upload_body = file_get_contents('/path/to/file'); -$logo_upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $logo_upload_headers, $logo_upload_body); +$logo_upload_request = new Request('POST', $apiUrl.'/upload', $logo_upload_headers, $logo_upload_body); $logo_upload_res = $upload_client->sendAsync($logo_upload_request)->wait(); echo $logo_upload_res->getBody() . PHP_EOL; @@ -77,6 +85,6 @@ 'Content-Type' => 'application/json' ]; $signing_body = '{"id":"'.$uploaded_input_id.'", "pfx_credential_id":"'.$uploaded_credentials_id.'", "pfx_passphrase_id":"'.$uploaded_passphrase_id.'", "logo_id":"'.$uploaded_logo_id.'", "signature_configuration":"'.$signature_config.'"}'; -$signing_request = new Request('POST', 'https://api.pdfrest.com/signed-pdf', $signing_headers, $signing_body); +$signing_request = new Request('POST', $apiUrl.'/signed-pdf', $signing_headers, $signing_body); $signing_res = $signing_client->sendAsync($signing_request)->wait(); echo $signing_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/split-pdf.php b/PHP/Endpoint Examples/JSON Payload/split-pdf.php index b576b90c..d7783acd 100644 --- a/PHP/Endpoint Examples/JSON Payload/split-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/split-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $split_body = '{"id":"'.$uploaded_id.'"}'; -$split_request = new Request('POST', 'https://api.pdfrest.com/split-pdf', $split_headers, $split_body); +$split_request = new Request('POST', $apiUrl.'/split-pdf', $split_headers, $split_body); $split_res = $split_client->sendAsync($split_request)->wait(); echo $split_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/tif.php b/PHP/Endpoint Examples/JSON Payload/tif.php index bcf131a1..26c65c31 100644 --- a/PHP/Endpoint Examples/JSON Payload/tif.php +++ b/PHP/Endpoint Examples/JSON Payload/tif.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $tif_body = '{"id":"'.$uploaded_id.'"}'; -$tif_request = new Request('POST', 'https://api.pdfrest.com/tif', $tif_headers, $tif_body); +$tif_request = new Request('POST', $apiUrl.'/tif', $tif_headers, $tif_body); $tif_res = $tif_client->sendAsync($tif_request)->wait(); echo $tif_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/unrestricted-pdf.php b/PHP/Endpoint Examples/JSON Payload/unrestricted-pdf.php index b0c45605..1aaee677 100644 --- a/PHP/Endpoint Examples/JSON Payload/unrestricted-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/unrestricted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -31,14 +39,14 @@ 'Content-Type' => 'application/json' ]; $unrestrict_body = '{"id":"'.$uploaded_id.'", "current_permissions_password":"password"}'; -$unrestrict_request = new Request('POST', 'https://api.pdfrest.com/unrestricted-pdf', $unrestrict_headers, $unrestrict_body); +$unrestrict_request = new Request('POST', $apiUrl.'/unrestricted-pdf', $unrestrict_headers, $unrestrict_body); $unrestrict_res = $unrestrict_client->sendAsync($unrestrict_request)->wait(); $unrestrict_body = (string) $unrestrict_res->getBody(); echo $unrestrict_body . PHP_EOL; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -51,7 +59,7 @@ ]; $unrestrict_json = json_decode($unrestrict_body, true); $delete_body = '{"ids":"'.$uploaded_id.', '.$unrestrict_json['outputId'].'"}'; - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/unzip.php b/PHP/Endpoint Examples/JSON Payload/unzip.php index f08f5cc8..61fd59cb 100644 --- a/PHP/Endpoint Examples/JSON Payload/unzip.php +++ b/PHP/Endpoint Examples/JSON Payload/unzip.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $unzip_body = '{"id":"'.$uploaded_id.'"}'; -$unzip_request = new Request('POST', 'https://api.pdfrest.com/unzip', $unzip_headers, $unzip_body); +$unzip_request = new Request('POST', $apiUrl.'/unzip', $unzip_headers, $unzip_body); $unzip_res = $unzip_client->sendAsync($unzip_request)->wait(); echo $unzip_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/up-toolkit.php b/PHP/Endpoint Examples/JSON Payload/up-toolkit.php index 47be1ea4..3471f128 100644 --- a/PHP/Endpoint Examples/JSON Payload/up-toolkit.php +++ b/PHP/Endpoint Examples/JSON Payload/up-toolkit.php @@ -1,8 +1,14 @@ false]); $headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,6 +20,6 @@ 'Content-Type' => 'application/octet-stream' ]; $body = file_get_contents('/path/to/file'); -$request = new Request('POST', 'https://api.pdfrest.com/upload', $headers, $body); +$request = new Request('POST', $apiUrl.'/upload', $headers, $body); $res = $client->sendAsync($request)->wait(); echo $res->getBody(); diff --git a/PHP/Endpoint Examples/JSON Payload/watermarked-pdf.php b/PHP/Endpoint Examples/JSON Payload/watermarked-pdf.php index 230b5b8d..468aec7b 100644 --- a/PHP/Endpoint Examples/JSON Payload/watermarked-pdf.php +++ b/PHP/Endpoint Examples/JSON Payload/watermarked-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -15,7 +23,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -31,16 +39,16 @@ 'Content-Type' => 'application/json' ]; $watermark_body = '{"id":"'.$uploaded_id.'", "watermark_text":"TEXT"}'; -$watermark_request = new Request('POST', 'https://api.pdfrest.com/watermarked-pdf', $watermark_headers, $watermark_body); +$watermark_request = new Request('POST', $apiUrl.'/watermarked-pdf', $watermark_headers, $watermark_body); $watermark_res = $watermark_client->sendAsync($watermark_request)->wait(); $watermark_body_str = (string)$watermark_res->getBody(); echo $watermark_body_str . PHP_EOL; $watermark_response_json = json_decode($watermark_body_str); $output_id = $watermark_response_json->{'outputId'} ?? ''; -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -52,7 +60,7 @@ 'Content-Type' => 'application/json' ]; $delete_body = '{"ids":"' . $uploaded_id . ', ' . $output_id . '"}'; - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/JSON Payload/word.php b/PHP/Endpoint Examples/JSON Payload/word.php index 6d8aeca6..3008bd76 100644 --- a/PHP/Endpoint Examples/JSON Payload/word.php +++ b/PHP/Endpoint Examples/JSON Payload/word.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_client = new Client(['http_errors' => false]); $upload_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_body = file_get_contents('/path/to/file'); -$upload_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_headers, $upload_body); +$upload_request = new Request('POST', $apiUrl.'/upload', $upload_headers, $upload_body); $upload_res = $upload_client->sendAsync($upload_request)->wait(); echo $upload_res->getBody() . PHP_EOL; @@ -28,6 +36,6 @@ 'Content-Type' => 'application/json' ]; $word_body = '{"id":"'.$uploaded_id.'"}'; -$word_request = new Request('POST', 'https://api.pdfrest.com/word', $word_headers, $word_body); +$word_request = new Request('POST', $apiUrl.'/word', $word_headers, $word_body); $word_res = $word_client->sendAsync($word_request)->wait(); echo $word_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/JSON Payload/zip.php b/PHP/Endpoint Examples/JSON Payload/zip.php index 99ab05a4..c8b8f0c0 100644 --- a/PHP/Endpoint Examples/JSON Payload/zip.php +++ b/PHP/Endpoint Examples/JSON Payload/zip.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $upload_first_file_client = new Client(['http_errors' => false]); $upload_first_file_headers = [ 'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', @@ -12,7 +20,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_first_file_body = file_get_contents('/path/to/first_file'); -$upload_first_file_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_first_file_headers, $upload_first_file_body); +$upload_first_file_request = new Request('POST', $apiUrl.'/upload', $upload_first_file_headers, $upload_first_file_body); $upload_first_file_res = $upload_first_file_client->sendAsync($upload_first_file_request)->wait(); echo $upload_first_file_res->getBody() . PHP_EOL; @@ -30,7 +38,7 @@ 'Content-Type' => 'application/octet-stream' ]; $upload_second_file_body = file_get_contents('/path/to/second_file'); -$upload_second_file_request = new Request('POST', 'https://api.pdfrest.com/upload', $upload_second_file_headers, $upload_second_file_body); +$upload_second_file_request = new Request('POST', $apiUrl.'/upload', $upload_second_file_headers, $upload_second_file_body); $upload_second_file_res = $upload_second_file_client->sendAsync($upload_second_file_request)->wait(); echo $upload_second_file_res->getBody() . PHP_EOL; @@ -48,6 +56,6 @@ 'Content-Type' => 'application/json' ]; $zip_body = '{"id":["'.$uploaded_first_file_id.'", "'.$uploaded_second_file_id.'"]}'; -$zip_request = new Request('POST', 'https://api.pdfrest.com/zip', $zip_headers, $zip_body); +$zip_request = new Request('POST', $apiUrl.'/zip', $zip_headers, $zip_body); $zip_res = $zip_client->sendAsync($zip_request)->wait(); echo $zip_res->getBody() . PHP_EOL; diff --git a/PHP/Endpoint Examples/Multipart Payload/batch-delete.php b/PHP/Endpoint Examples/Multipart Payload/batch-delete.php index 23a4e2c6..7e4456d1 100644 --- a/PHP/Endpoint Examples/Multipart Payload/batch-delete.php +++ b/PHP/Endpoint Examples/Multipart Payload/batch-delete.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -20,7 +28,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/delete', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/delete', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/bmp.php b/PHP/Endpoint Examples/Multipart Payload/bmp.php index 0210d2d0..078ddf1f 100644 --- a/PHP/Endpoint Examples/Multipart Payload/bmp.php +++ b/PHP/Endpoint Examples/Multipart Payload/bmp.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -40,7 +48,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/bmp', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/bmp', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/compressed-pdf.php b/PHP/Endpoint Examples/Multipart Payload/compressed-pdf.php index 3ffba620..003118f7 100644 --- a/PHP/Endpoint Examples/Multipart Payload/compressed-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/compressed-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/compressed-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/compressed-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/decrypted-pdf.php b/PHP/Endpoint Examples/Multipart Payload/decrypted-pdf.php index 6ab640c4..0daadfa5 100644 --- a/PHP/Endpoint Examples/Multipart Payload/decrypted-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/decrypted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -35,16 +43,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/decrypted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/decrypted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body = (string) $res->getBody(); echo $body; // Output the response body -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -59,7 +67,7 @@ $input_id = isset($json['inputId']) ? $json['inputId'] : ''; $output_id = isset($json['outputId']) ? $json['outputId'] : ''; $delete_body = json_encode([ 'ids' => $input_id . ', ' . $output_id ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/delete-resource.php b/PHP/Endpoint Examples/Multipart Payload/delete-resource.php index 0ff24cff..3e58b938 100644 --- a/PHP/Endpoint Examples/Multipart Payload/delete-resource.php +++ b/PHP/Endpoint Examples/Multipart Payload/delete-resource.php @@ -1,9 +1,17 @@ 'https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + CURLOPT_URL => $apiUrl.'/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, diff --git a/PHP/Endpoint Examples/Multipart Payload/encrypted-pdf.php b/PHP/Endpoint Examples/Multipart Payload/encrypted-pdf.php index 1ed2e37f..5ae00342 100644 --- a/PHP/Endpoint Examples/Multipart Payload/encrypted-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/encrypted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -35,16 +43,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/encrypted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/encrypted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body_str = (string)$res->getBody(); echo $body_str; // Output the response body, which contains the encrypted PDF content. -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -59,7 +67,7 @@ $input_id = isset($parsed['inputId']) ? $parsed['inputId'] : ''; $output_id = isset($parsed['outputId']) ? $parsed['outputId'] : ''; $delete_body = json_encode([ 'ids' => "$input_id, $output_id" ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/excel.php b/PHP/Endpoint Examples/Multipart Payload/excel.php index 127257b3..81096dc1 100644 --- a/PHP/Endpoint Examples/Multipart Payload/excel.php +++ b/PHP/Endpoint Examples/Multipart Payload/excel.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/excel', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/excel', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/exported-form-data.php b/PHP/Endpoint Examples/Multipart Payload/exported-form-data.php index 2a10f29a..011a54e1 100644 --- a/PHP/Endpoint Examples/Multipart Payload/exported-form-data.php +++ b/PHP/Endpoint Examples/Multipart Payload/exported-form-data.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/exported-form-data', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/exported-form-data', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/extracted-images.php b/PHP/Endpoint Examples/Multipart Payload/extracted-images.php index 9a5ce48d..d5e9fdb1 100644 --- a/PHP/Endpoint Examples/Multipart Payload/extracted-images.php +++ b/PHP/Endpoint Examples/Multipart Payload/extracted-images.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/extracted-images', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/extracted-images', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/extracted-text.php b/PHP/Endpoint Examples/Multipart Payload/extracted-text.php index 708a101a..610a51bc 100644 --- a/PHP/Endpoint Examples/Multipart Payload/extracted-text.php +++ b/PHP/Endpoint Examples/Multipart Payload/extracted-text.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/extracted-text', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/extracted-text', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.php b/PHP/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.php index 0986e670..61b5b473 100644 --- a/PHP/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/flattened-annotations-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/flattened-annotations-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/flattened-forms-pdf.php b/PHP/Endpoint Examples/Multipart Payload/flattened-forms-pdf.php index ab1f243c..2a033b8e 100644 --- a/PHP/Endpoint Examples/Multipart Payload/flattened-forms-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/flattened-forms-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); $headers = [ 'Api-Key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' @@ -25,7 +33,7 @@ ] ]]; -$request = new Request('POST', 'https://api.pdfrest.com/flattened-forms-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/flattened-forms-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/flattened-layers-pdf.php b/PHP/Endpoint Examples/Multipart Payload/flattened-layers-pdf.php index 19867564..eb2ef4f1 100644 --- a/PHP/Endpoint Examples/Multipart Payload/flattened-layers-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/flattened-layers-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/flattened-layers-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/flattened-layers-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.php b/PHP/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.php index e4228493..743d4956 100644 --- a/PHP/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/flattened-transparencies-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/flattened-transparencies-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/get-resource.php b/PHP/Endpoint Examples/Multipart Payload/get-resource.php index 3d1f1f74..47397ac7 100644 --- a/PHP/Endpoint Examples/Multipart Payload/get-resource.php +++ b/PHP/Endpoint Examples/Multipart Payload/get-resource.php @@ -1,13 +1,23 @@ sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/jpg.php b/PHP/Endpoint Examples/Multipart Payload/jpg.php index bce4a13c..9a3804fb 100644 --- a/PHP/Endpoint Examples/Multipart Payload/jpg.php +++ b/PHP/Endpoint Examples/Multipart Payload/jpg.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -44,7 +52,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/jpg', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/jpg', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/linearized-pdf.php b/PHP/Endpoint Examples/Multipart Payload/linearized-pdf.php index 7cf3bca0..be61fc9b 100644 --- a/PHP/Endpoint Examples/Multipart Payload/linearized-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/linearized-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/linearized-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/linearized-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/markdown.php b/PHP/Endpoint Examples/Multipart Payload/markdown.php index 2c17cc27..925b8829 100644 --- a/PHP/Endpoint Examples/Multipart Payload/markdown.php +++ b/PHP/Endpoint Examples/Multipart Payload/markdown.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,8 +36,8 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/markdown', $headers); // Create a new HTTP POST request with the updated /markdown endpoint and headers. +$request = new Request('POST', $apiUrl.'/markdown', $headers); // Create a new HTTP POST request with the updated /markdown endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. -echo $res->getBody(); // Output the response body, which contains the generated markdown from the document. \ No newline at end of file +echo $res->getBody(); // Output the response body, which contains the generated markdown from the document. diff --git a/PHP/Endpoint Examples/Multipart Payload/merged-pdf.php b/PHP/Endpoint Examples/Multipart Payload/merged-pdf.php index 035f71d2..3ef0d081 100644 --- a/PHP/Endpoint Examples/Multipart Payload/merged-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/merged-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -64,7 +72,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/merged-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/merged-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-info.php b/PHP/Endpoint Examples/Multipart Payload/pdf-info.php index ed482865..1c35b266 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-info.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-info.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-info', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-info', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-acroforms.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-acroforms.php index 87dbf734..98b96ff3 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-acroforms.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-acroforms.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-acroforms', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-acroforms', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.php index f1dad929..8371ef6f 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -36,7 +44,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-attachment', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-added-attachment', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-image.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-image.php index 19fae81b..7a423cc3 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-image.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-image.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -48,7 +56,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-image', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-added-image', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-text.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-text.php index 80fd0086..cea20ee8 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-text.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-added-text.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-added-text', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-added-text', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.php index bb107ac4..85b0f1c8 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-converted-colors', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-converted-colors', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.php index 303a0b87..ea9a3c53 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); $headers = [ 'Api-Key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' @@ -33,7 +41,7 @@ ] ]]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-imported-form-data', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-imported-form-data', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.php index 76073f25..79ff467d 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-ocr-text', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-ocr-text', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.php index 22ee6e1d..69fa31b7 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-page-boxes-set', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-page-boxes-set', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.php index e4d34afd..8d42fde2 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -31,16 +39,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-redacted-text-applied', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-redacted-text-applied', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body_str = (string)$res->getBody(); echo $body_str; // Output the response body, which contains the document with finalized text redactions. -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -55,7 +63,7 @@ $input_id = isset($parsed['inputId']) ? $parsed['inputId'] : ''; $output_id = isset($parsed['outputId']) ? $parsed['outputId'] : ''; $delete_body = json_encode([ 'ids' => "$input_id, $output_id" ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.php b/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.php index 227ca619..5e85b230 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -35,16 +43,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf-with-redacted-text-preview', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf-with-redacted-text-preview', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body_str = (string)$res->getBody(); echo $body_str; // Output the response body, which contains the PDF with redaction preview annotations. -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -61,7 +69,7 @@ // IMPORTANT: Do not delete the $output_id (the preview PDF) file until after the redaction is applied // with the /pdf-with-redacted-text-applied endpoint. $delete_body = json_encode([ 'ids' => $input_id . ', ' . $output_id ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/pdf.php b/PHP/Endpoint Examples/Multipart Payload/pdf.php index b1e030aa..af36b545 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -40,7 +48,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdfa.php b/PHP/Endpoint Examples/Multipart Payload/pdfa.php index 1651c8ca..e53bf1d4 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdfa.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdfa.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdfa', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdfa', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/pdfx.php b/PHP/Endpoint Examples/Multipart Payload/pdfx.php index b5c2d992..0a488e49 100644 --- a/PHP/Endpoint Examples/Multipart Payload/pdfx.php +++ b/PHP/Endpoint Examples/Multipart Payload/pdfx.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -32,7 +40,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/pdfx', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/pdfx', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/png.php b/PHP/Endpoint Examples/Multipart Payload/png.php index 8a570e4f..df84715a 100644 --- a/PHP/Endpoint Examples/Multipart Payload/png.php +++ b/PHP/Endpoint Examples/Multipart Payload/png.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -40,7 +48,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/png', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/png', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/powerpoint.php b/PHP/Endpoint Examples/Multipart Payload/powerpoint.php index b4c188f1..150e1efd 100644 --- a/PHP/Endpoint Examples/Multipart Payload/powerpoint.php +++ b/PHP/Endpoint Examples/Multipart Payload/powerpoint.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/powerpoint', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/powerpoint', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/rasterized-pdf.php b/PHP/Endpoint Examples/Multipart Payload/rasterized-pdf.php index 25b8ff67..9c6f72f3 100644 --- a/PHP/Endpoint Examples/Multipart Payload/rasterized-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/rasterized-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/rasterized-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/rasterized-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/request-status.php b/PHP/Endpoint Examples/Multipart Payload/request-status.php index e6136c04..40245c58 100644 --- a/PHP/Endpoint Examples/Multipart Payload/request-status.php +++ b/PHP/Endpoint Examples/Multipart Payload/request-status.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client $apiKey = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'; // Your API key goes here. @@ -28,7 +36,7 @@ ]; // Using /png as an arbitrary example, send a request with the Request-Type header. -$pngRequest = new Request('POST', 'https://api.pdfrest.com/png', $headers); +$pngRequest = new Request('POST', $apiUrl.'/png', $headers); $pngResponse = $client->sendAsync($pngRequest, $pngOptions)->wait(); @@ -39,7 +47,7 @@ $requestId = json_decode($pngResponse->getBody())->{'requestId'}; // Get the status of the PNG request by its ID. -$request_status_endpoint_url = 'https://api.pdfrest.com/request-status/'.$requestId; +$request_status_endpoint_url = $apiUrl.'/request-status/'.$requestId; $headers = [ 'Api-Key' => $apiKey diff --git a/PHP/Endpoint Examples/Multipart Payload/restricted-pdf.php b/PHP/Endpoint Examples/Multipart Payload/restricted-pdf.php index c7dca3a3..f05e37aa 100644 --- a/PHP/Endpoint Examples/Multipart Payload/restricted-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/restricted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -47,16 +55,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/restricted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/restricted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body_str = (string)$res->getBody(); echo $body_str; // Output the response body, which contains the restricted PDF with specified permissions. -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -71,7 +79,7 @@ $input_id = isset($parsed['inputId']) ? $parsed['inputId'] : ''; $output_id = isset($parsed['outputId']) ? $parsed['outputId'] : ''; $delete_body = json_encode([ 'ids' => "$input_id, $output_id" ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.php b/PHP/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.php index c554b781..2b492731 100644 --- a/PHP/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.php +++ b/PHP/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -48,7 +56,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/signed-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/signed-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/signed-pdf.php b/PHP/Endpoint Examples/Multipart Payload/signed-pdf.php index f225edac..ebb0dbd1 100644 --- a/PHP/Endpoint Examples/Multipart Payload/signed-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/signed-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -56,7 +64,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/signed-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/signed-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/split-pdf.php b/PHP/Endpoint Examples/Multipart Payload/split-pdf.php index f07e2535..c687ec1f 100644 --- a/PHP/Endpoint Examples/Multipart Payload/split-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/split-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -40,7 +48,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/split-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/split-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/tif.php b/PHP/Endpoint Examples/Multipart Payload/tif.php index 779904b4..1639c068 100644 --- a/PHP/Endpoint Examples/Multipart Payload/tif.php +++ b/PHP/Endpoint Examples/Multipart Payload/tif.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -40,7 +48,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/tif', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/tif', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/unrestricted-pdf.php b/PHP/Endpoint Examples/Multipart Payload/unrestricted-pdf.php index c6ac74bc..95919052 100644 --- a/PHP/Endpoint Examples/Multipart Payload/unrestricted-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/unrestricted-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -35,16 +43,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/unrestricted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/unrestricted-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body = (string) $res->getBody(); echo $body; // Output the response body -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -59,7 +67,7 @@ $input_id = isset($json['inputId']) ? $json['inputId'] : ''; $output_id = isset($json['outputId']) ? $json['outputId'] : ''; $delete_body = json_encode([ 'ids' => $input_id . ', ' . $output_id ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/unzip.php b/PHP/Endpoint Examples/Multipart Payload/unzip.php index 9b4b06fb..56d7ca1a 100644 --- a/PHP/Endpoint Examples/Multipart Payload/unzip.php +++ b/PHP/Endpoint Examples/Multipart Payload/unzip.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -24,7 +32,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/unzip', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/unzip', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/up-toolkit.php b/PHP/Endpoint Examples/Multipart Payload/up-toolkit.php index 47be1ea4..940e7370 100644 --- a/PHP/Endpoint Examples/Multipart Payload/up-toolkit.php +++ b/PHP/Endpoint Examples/Multipart Payload/up-toolkit.php @@ -1,8 +1,17 @@ sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/watermarked-pdf.php b/PHP/Endpoint Examples/Multipart Payload/watermarked-pdf.php index b9d00175..7b9f2b33 100644 --- a/PHP/Endpoint Examples/Multipart Payload/watermarked-pdf.php +++ b/PHP/Endpoint Examples/Multipart Payload/watermarked-pdf.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + // Toggle deletion of sensitive files (default: false) $DELETE_SENSITIVE_FILES = false; @@ -35,16 +43,16 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/watermarked-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/watermarked-pdf', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. $body_str = (string)$res->getBody(); echo $body_str; // Output the response body, which contains the watermarked PDF content. -// All files uploaded or generated are automatically deleted based on the -// File Retention Period as shown on https://pdfrest.com/pricing. -// For immediate deletion of files, particularly when sensitive data +// All files uploaded or generated are automatically deleted based on the +// File Retention Period as shown on https://pdfrest.com/pricing. +// For immediate deletion of files, particularly when sensitive data // is involved, an explicit delete call can be made to the API. // // Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -59,7 +67,7 @@ $input_id = $parsed['inputId'][0]; $output_id = isset($parsed['outputId']) ? $parsed['outputId'] : ''; $delete_body = json_encode([ 'ids' => "$input_id, $output_id" ]); - $delete_request = new Request('POST', 'https://api.pdfrest.com/delete', $delete_headers, $delete_body); + $delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body); $delete_res = $delete_client->sendAsync($delete_request)->wait(); echo $delete_res->getBody() . PHP_EOL; } diff --git a/PHP/Endpoint Examples/Multipart Payload/word.php b/PHP/Endpoint Examples/Multipart Payload/word.php index df442c7c..3b653192 100644 --- a/PHP/Endpoint Examples/Multipart Payload/word.php +++ b/PHP/Endpoint Examples/Multipart Payload/word.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); // Create a new instance of the Guzzle HTTP client. $headers = [ @@ -28,7 +36,7 @@ ] ]; -$request = new Request('POST', 'https://api.pdfrest.com/word', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/word', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/PHP/Endpoint Examples/Multipart Payload/zip.php b/PHP/Endpoint Examples/Multipart Payload/zip.php index ca8ec69a..d8e2bee3 100644 --- a/PHP/Endpoint Examples/Multipart Payload/zip.php +++ b/PHP/Endpoint Examples/Multipart Payload/zip.php @@ -5,6 +5,14 @@ use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class. use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams. +// By default, we use the US-based API service. This is the primary endpoint for global use. +$apiUrl = "https://api.pdfrest.com"; + +/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. + * For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work + */ +//$apiUrl = "https://eu-api.pdfrest.com"; + $client = new Client(); $headers = [ 'Api-Key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' @@ -37,7 +45,7 @@ ] ]]; -$request = new Request('POST', 'https://api.pdfrest.com/zip', $headers); // Create a new HTTP POST request with the API endpoint and headers. +$request = new Request('POST', $apiUrl.'/zip', $headers); // Create a new HTTP POST request with the API endpoint and headers. $res = $client->sendAsync($request, $options)->wait(); // Send the asynchronous request and wait for the response. diff --git a/Python/Complex Flow Examples/decrypt-add-reencrypt.py b/Python/Complex Flow Examples/decrypt-add-reencrypt.py index 324ceb1e..3821cd84 100644 --- a/Python/Complex Flow Examples/decrypt-add-reencrypt.py +++ b/Python/Complex Flow Examples/decrypt-add-reencrypt.py @@ -10,9 +10,16 @@ # and then sending the output with the new image through /encrypted-pdf to # lock it up again. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -decrypted_pdf_endpoint_url = 'https://api.pdfrest.com/decrypted-pdf' +decrypted_pdf_endpoint_url = api_url+'/decrypted-pdf' mp_encoder_decryptedPdf = MultipartEncoder( fields={ @@ -37,7 +44,7 @@ decrypted_id = response_json["outputId"] - pdf_with_added_image_endpoint_url = 'https://api.pdfrest.com/pdf-with-added-image' + pdf_with_added_image_endpoint_url = api_url+'/pdf-with-added-image' mp_encoder_pdfWithAddedImage = MultipartEncoder( fields={ @@ -64,7 +71,7 @@ response_json = response.json() added_image_id = response_json["outputId"] - encrypted_pdf_endpoint_url = 'https://api.pdfrest.com/encrypted-pdf' + encrypted_pdf_endpoint_url = api_url+'/encrypted-pdf' mp_encoder_encryptedPdf = MultipartEncoder( fields={ diff --git a/Python/Complex Flow Examples/merge-different-file-types.py b/Python/Complex Flow Examples/merge-different-file-types.py index 1dd98f29..cc6623e0 100644 --- a/Python/Complex Flow Examples/merge-different-file-types.py +++ b/Python/Complex Flow Examples/merge-different-file-types.py @@ -14,9 +14,16 @@ # this sample could be easily used to convert and combine any two file types # that the /pdf route takes as inputs. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -pdf_endpoint_url = 'https://api.pdfrest.com/pdf' +pdf_endpoint_url = api_url+'/pdf' mp_encoder_image_pdf = MultipartEncoder( fields={ 'file': ('file_name.png', open('/path/to/file.png', 'rb'), 'image/png'), @@ -65,7 +72,7 @@ ppt_id = response_json["outputId"] print("Got the second output ID: " + image_id) - merged_pdf_endpoint_url = 'https://api.pdfrest.com/merged-pdf' + merged_pdf_endpoint_url = api_url+'/merged-pdf' merge_request_data = [('id', image_id), ('pages', '1-last'), ('type', 'id'), ('id', ppt_id), ('pages', '1-last'), ('type', 'id'), ('output', 'multiple_file_types')] mp_encoder_merge = MultipartEncoder( diff --git a/Python/Complex Flow Examples/ocr-with-extract-text.py b/Python/Complex Flow Examples/ocr-with-extract-text.py index 3f80b82b..eca01b66 100644 --- a/Python/Complex Flow Examples/ocr-with-extract-text.py +++ b/Python/Complex Flow Examples/ocr-with-extract-text.py @@ -10,9 +10,16 @@ # output ID. Then, we will send the output ID to the /extracted-text route, which will # return the newly added text. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -ocr_endpoint_url = 'https://api.pdfrest.com/pdf-with-ocr-text' +ocr_endpoint_url = api_url+'/pdf-with-ocr-text' mp_encoder_pdf = MultipartEncoder( fields={ 'file': ('file_name.pdf', open('/path/to/file.pdf', 'rb'), 'application/pdf'), @@ -36,7 +43,7 @@ ocr_pdf_id = response_json["outputId"] print("Got the output ID: " + ocr_pdf_id) - extract_endpoint_url = 'https://api.pdfrest.com/extracted-text' + extract_endpoint_url = api_url+'/extracted-text' mp_encoder_extract_text = MultipartEncoder( fields={ @@ -64,4 +71,4 @@ else: - print(response.text) \ No newline at end of file + print(response.text) diff --git a/Python/Complex Flow Examples/pdfa-3b-with-attachment.py b/Python/Complex Flow Examples/pdfa-3b-with-attachment.py index c9dcc6c8..da0f54e9 100644 --- a/Python/Complex Flow Examples/pdfa-3b-with-attachment.py +++ b/Python/Complex Flow Examples/pdfa-3b-with-attachment.py @@ -11,9 +11,16 @@ # Note that there is nothing special about attaching an xml file, and any appropriate # file may be attached and wrapped into the PDF/A conversion. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -pdf_with_added_attachment_endpoint_url = 'https://api.pdfrest.com/pdf-with-added-attachment' +pdf_with_added_attachment_endpoint_url = api_url+'/pdf-with-added-attachment' mp_encoder_pdfWithAddedAttachment = MultipartEncoder( fields={ @@ -38,7 +45,7 @@ response_json = response.json() pdfWithAddedAttachment_id = response_json["outputId"] - pdfa_endpoint_url = 'https://api.pdfrest.com/pdfa' + pdfa_endpoint_url = api_url+'/pdfa' mp_encoder_pdfa = MultipartEncoder( fields={ diff --git a/Python/Complex Flow Examples/preserve-word-document.py b/Python/Complex Flow Examples/preserve-word-document.py index 541af595..c9b8a83c 100644 --- a/Python/Complex Flow Examples/preserve-word-document.py +++ b/Python/Complex Flow Examples/preserve-word-document.py @@ -8,9 +8,16 @@ # a PDF with a call to the /pdf route. Then, we will take that converted PDF # and convert it to the PDF/A format for long-term storage. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -pdf_endpoint_url = 'https://api.pdfrest.com/pdf' +pdf_endpoint_url = api_url+'/pdf' mp_encoder_pdf = MultipartEncoder( fields={ @@ -34,7 +41,7 @@ pdf_id = response_json["outputId"] - pdfa_endpoint_url = 'https://api.pdfrest.com/pdfa' + pdfa_endpoint_url = api_url+'/pdfa' mp_encoder_pdfa = MultipartEncoder( fields={ diff --git a/Python/Complex Flow Examples/protected-watermark.py b/Python/Complex Flow Examples/protected-watermark.py index fd058b54..ccc2f00a 100644 --- a/Python/Complex Flow Examples/protected-watermark.py +++ b/Python/Complex Flow Examples/protected-watermark.py @@ -9,9 +9,16 @@ # We will be running the input file through /watermarked-pdf to apply the watermark # and then /restricted-pdf to lock the watermark in. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -watermarked_pdf_endpoint_url = 'https://api.pdfrest.com/watermarked-pdf' +watermarked_pdf_endpoint_url = api_url+'/watermarked-pdf' mp_encoder_watermarkedPDF = MultipartEncoder( fields={ @@ -36,7 +43,7 @@ watermarked_id = response_json["outputId"] - restricted_pdf_endpoint_url = 'https://api.pdfrest.com/restricted-pdf' + restricted_pdf_endpoint_url = api_url+'/restricted-pdf' mp_encoder_restrictedPdf = MultipartEncoder( fields=[ diff --git a/Python/Complex Flow Examples/redact-preview-and-finalize.py b/Python/Complex Flow Examples/redact-preview-and-finalize.py index c6e2a844..8ee900b6 100644 --- a/Python/Complex Flow Examples/redact-preview-and-finalize.py +++ b/Python/Complex Flow Examples/redact-preview-and-finalize.py @@ -8,9 +8,16 @@ # the preview stage before utilizing this workflow to ensure that content is # redacted as intended. +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -pdf_endpoint_url = 'https://api.pdfrest.com/pdf-with-redacted-text-preview' +pdf_endpoint_url = api_url+'/pdf-with-redacted-text-preview' redaction_options = [ { @@ -43,7 +50,7 @@ pdf_id = response_json["outputId"] - applied_endpoint_url = 'https://api.pdfrest.com/pdf-with-redacted-text-applied' + applied_endpoint_url = api_url+'/pdf-with-redacted-text-applied' mp_encoder_applied = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/JSON Payload/batch-delete.py b/Python/Endpoint Examples/JSON Payload/batch-delete.py index 3eca985a..387e8d33 100644 --- a/Python/Endpoint Examples/JSON Payload/batch-delete.py +++ b/Python/Endpoint Examples/JSON Payload/batch-delete.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + delete_data = { "ids" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } print("Processing files...") -delete_response = requests.post(url='https://api.pdfrest.com/delete', +delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/bmp.py b/Python/Endpoint Examples/JSON Payload/bmp.py index 38fc76b4..977caf5c 100644 --- a/Python/Endpoint Examples/JSON Payload/bmp.py +++ b/Python/Endpoint Examples/JSON Payload/bmp.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - bmp_response = requests.post(url='https://api.pdfrest.com/bmp', + bmp_response = requests.post(url=api_url+'/bmp', data=json.dumps(bmp_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/compressed-pdf.py b/Python/Endpoint Examples/JSON Payload/compressed-pdf.py index 435ae471..c537ebf6 100644 --- a/Python/Endpoint Examples/JSON Payload/compressed-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/compressed-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - compress_response = requests.post(url='https://api.pdfrest.com/compressed-pdf', + compress_response = requests.post(url=api_url+'/compressed-pdf', data=json.dumps(compress_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/decrypted-pdf.py b/Python/Endpoint Examples/JSON Payload/decrypted-pdf.py index 8dedd598..d3081e86 100644 --- a/Python/Endpoint Examples/JSON Payload/decrypted-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/decrypted-pdf.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -25,7 +32,7 @@ print("Processing file...") - decrypt_response = requests.post(url='https://api.pdfrest.com/decrypted-pdf', + decrypt_response = requests.post(url=api_url+'/decrypted-pdf', data=json.dumps(decrypt_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -36,9 +43,9 @@ decrypt_response_json = decrypt_response.json() print(json.dumps(decrypt_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -46,7 +53,7 @@ if DELETE_SENSITIVE_FILES: result_id = decrypt_response_json['outputId'] delete_data = { "ids": f"{uploaded_id}, {result_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print(json.dumps(delete_response.json(), indent = 2)) diff --git a/Python/Endpoint Examples/JSON Payload/delete-resource.py b/Python/Endpoint Examples/JSON Payload/delete-resource.py index cdefb36e..9134d70e 100644 --- a/Python/Endpoint Examples/JSON Payload/delete-resource.py +++ b/Python/Endpoint Examples/JSON Payload/delete-resource.py @@ -1,6 +1,13 @@ import requests -url = "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +url = f"{api_url}/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" payload = {} headers = { diff --git a/Python/Endpoint Examples/JSON Payload/encrypted-pdf.py b/Python/Endpoint Examples/JSON Payload/encrypted-pdf.py index 5e1f3c05..c132f4ad 100644 --- a/Python/Endpoint Examples/JSON Payload/encrypted-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/encrypted-pdf.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -24,7 +31,7 @@ print(json.dumps(encrypt_data, indent = 2)) print("Processing file...") - encrypt_response = requests.post(url='https://api.pdfrest.com/encrypted-pdf', + encrypt_response = requests.post(url=api_url+'/encrypted-pdf', data=json.dumps(encrypt_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -35,9 +42,9 @@ encrypt_response_json = encrypt_response.json() print(json.dumps(encrypt_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -45,7 +52,7 @@ if DELETE_SENSITIVE_FILES: encrypted_output_id = encrypt_response_json['outputId'] delete_data = { "ids": f"{uploaded_id}, {encrypted_output_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) if delete_response.ok: diff --git a/Python/Endpoint Examples/JSON Payload/excel.py b/Python/Endpoint Examples/JSON Payload/excel.py index 92512a37..a1a64db6 100644 --- a/Python/Endpoint Examples/JSON Payload/excel.py +++ b/Python/Endpoint Examples/JSON Payload/excel.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - excel_response = requests.post(url='https://api.pdfrest.com/excel', + excel_response = requests.post(url=api_url+'/excel', data=json.dumps(excel_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/exported-form-data.py b/Python/Endpoint Examples/JSON Payload/exported-form-data.py index d534d531..45faef62 100644 --- a/Python/Endpoint Examples/JSON Payload/exported-form-data.py +++ b/Python/Endpoint Examples/JSON Payload/exported-form-data.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - export_response = requests.post(url='https://api.pdfrest.com/exported-form-data', + export_response = requests.post(url=api_url+'/exported-form-data', data=json.dumps(export_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/extracted-images.py b/Python/Endpoint Examples/JSON Payload/extracted-images.py index 20355bba..720f6b51 100644 --- a/Python/Endpoint Examples/JSON Payload/extracted-images.py +++ b/Python/Endpoint Examples/JSON Payload/extracted-images.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - extract_response = requests.post(url='https://api.pdfrest.com/extracted-images', + extract_response = requests.post(url=api_url+'/extracted-images', data=json.dumps(extract_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/extracted-text.py b/Python/Endpoint Examples/JSON Payload/extracted-text.py index 56f40961..2bfcc7b2 100644 --- a/Python/Endpoint Examples/JSON Payload/extracted-text.py +++ b/Python/Endpoint Examples/JSON Payload/extracted-text.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - extract_response = requests.post(url='https://api.pdfrest.com/extracted-text', + extract_response = requests.post(url=api_url+'/extracted-text', data=json.dumps(extract_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/flattened-annotations-pdf.py b/Python/Endpoint Examples/JSON Payload/flattened-annotations-pdf.py index e9890c8e..3699ae73 100644 --- a/Python/Endpoint Examples/JSON Payload/flattened-annotations-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/flattened-annotations-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - flatten_response = requests.post(url='https://api.pdfrest.com/flattened-annotations-pdf', + flatten_response = requests.post(url=api_url+'/flattened-annotations-pdf', data=json.dumps(flatten_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/flattened-forms-pdf.py b/Python/Endpoint Examples/JSON Payload/flattened-forms-pdf.py index 0e8df489..54ef6b9b 100644 --- a/Python/Endpoint Examples/JSON Payload/flattened-forms-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/flattened-forms-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - flatten_response = requests.post(url='https://api.pdfrest.com/flattened-forms-pdf', + flatten_response = requests.post(url=api_url+'/flattened-forms-pdf', data=json.dumps(flatten_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/flattened-layers-pdf.py b/Python/Endpoint Examples/JSON Payload/flattened-layers-pdf.py index 1eed1b10..540f5458 100644 --- a/Python/Endpoint Examples/JSON Payload/flattened-layers-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/flattened-layers-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - flatten_response = requests.post(url='https://api.pdfrest.com/flattened-layers-pdf', + flatten_response = requests.post(url=api_url+'/flattened-layers-pdf', data=json.dumps(flatten_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.py b/Python/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.py index 8d73b717..076597df 100644 --- a/Python/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - flatten_response = requests.post(url='https://api.pdfrest.com/flattened-transparencies-pdf', + flatten_response = requests.post(url=api_url+'/flattened-transparencies-pdf', data=json.dumps(flatten_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/get-resource.py b/Python/Endpoint Examples/JSON Payload/get-resource.py index 35ae3ab2..9eba381d 100644 --- a/Python/Endpoint Examples/JSON Payload/get-resource.py +++ b/Python/Endpoint Examples/JSON Payload/get-resource.py @@ -1,15 +1,22 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Resource UUIDs can be found in the JSON response of POST requests as "outputId". Resource UUIDs usually look like this: '0950b9bdf-0465-4d3f-8ea3-d2894f1ae839'. id = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place resource uuid here -# The response format can be 'file' or 'url'. +# The response format can be 'file' or 'url'. # If 'url', then JSON containing the url of the resource file is returned. # If 'file', then the file itself is returned. format = 'file' -resource_url = f"https://api.pdfrest.com/resource/{id}?format={format}" +resource_url = f"{api_url}/resource/{id}?format={format}" print("Sending GET request to /resource/{id} endpoint...") response = requests.get(resource_url) diff --git a/Python/Endpoint Examples/JSON Payload/gif.py b/Python/Endpoint Examples/JSON Payload/gif.py index dbd0eb23..6f8e47c6 100644 --- a/Python/Endpoint Examples/JSON Payload/gif.py +++ b/Python/Endpoint Examples/JSON Payload/gif.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - gif_response = requests.post(url='https://api.pdfrest.com/gif', + gif_response = requests.post(url=api_url+'/gif', data=json.dumps(gif_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/jpg.py b/Python/Endpoint Examples/JSON Payload/jpg.py index 8c58ad1b..9c94b147 100644 --- a/Python/Endpoint Examples/JSON Payload/jpg.py +++ b/Python/Endpoint Examples/JSON Payload/jpg.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - jpg_response = requests.post(url='https://api.pdfrest.com/jpg', + jpg_response = requests.post(url=api_url+'/jpg', data=json.dumps(jpg_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/linearized-pdf.py b/Python/Endpoint Examples/JSON Payload/linearized-pdf.py index 97cb2232..24c2418e 100644 --- a/Python/Endpoint Examples/JSON Payload/linearized-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/linearized-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - linearize_response = requests.post(url='https://api.pdfrest.com/linearized-pdf', + linearize_response = requests.post(url=api_url+'/linearized-pdf', data=json.dumps(linearize_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/markdown.py b/Python/Endpoint Examples/JSON Payload/markdown.py index 630b5008..171c5107 100644 --- a/Python/Endpoint Examples/JSON Payload/markdown.py +++ b/Python/Endpoint Examples/JSON Payload/markdown.py @@ -1,12 +1,19 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") upload_response = requests.post( - url='https://api.pdfrest.com/upload', + url=api_url+'/upload', data=upload_data, headers={ 'Content-Type': 'application/octet-stream', @@ -27,7 +34,7 @@ print("Processing file...") markdown_response = requests.post( - url='https://api.pdfrest.com/markdown', + url=api_url+'/markdown', data=json.dumps(markdown_data), headers={ 'Content-Type': 'application/json', @@ -42,4 +49,4 @@ else: print(markdown_response.text) else: - print(upload_response.text) \ No newline at end of file + print(upload_response.text) diff --git a/Python/Endpoint Examples/JSON Payload/merged-pdf.py b/Python/Endpoint Examples/JSON Payload/merged-pdf.py index 20c08195..9dc6302a 100644 --- a/Python/Endpoint Examples/JSON Payload/merged-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/merged-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/first_file', 'rb') as f: upload_first_file_data = f.read() print("Uploading first PDF file...") -upload_first_file_response = requests.post(url='https://api.pdfrest.com/upload', +upload_first_file_response = requests.post(url=api_url+'/upload', data=upload_first_file_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'first_file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -16,7 +23,7 @@ upload_second_file_data = f.read() print("Uploading second PDF file...") -upload_second_file_response = requests.post(url='https://api.pdfrest.com/upload', +upload_second_file_response = requests.post(url=api_url+'/upload', data=upload_second_file_data , headers={'Content-Type': 'application/octet-stream', 'content-filename': 'second_file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -37,7 +44,7 @@ print("Processing file...") - merge_response = requests.post(url='https://api.pdfrest.com/merged-pdf', + merge_response = requests.post(url=api_url+'/merged-pdf', data=json.dumps(merge_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-added-text.py b/Python/Endpoint Examples/JSON Payload/pdf-with-added-text.py index 52af194a..96e40c4b 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-added-text.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-added-text.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -35,7 +42,7 @@ print("Processing file...") - add_text_response = requests.post(url='https://api.pdfrest.com/pdf-with-added-text', + add_text_response = requests.post(url=api_url+'/pdf-with-added-text', data=json.dumps(add_text_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-converted-colors.py b/Python/Endpoint Examples/JSON Payload/pdf-with-converted-colors.py index 1704dc6e..aa2241b9 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-converted-colors.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-converted-colors.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - convert_colors_response = requests.post(url='https://api.pdfrest.com/pdf-with-converted-colors', + convert_colors_response = requests.post(url=api_url+'/pdf-with-converted-colors', data=json.dumps(convert_colors_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.py b/Python/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.py index 0c63b0a9..85036177 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/pdf_file', 'rb') as f: upload_pdf_data = f.read() print("Uploading PDF file...") -upload_pdf_response = requests.post(url='https://api.pdfrest.com/upload', +upload_pdf_response = requests.post(url=api_url+'/upload', data=upload_pdf_data, headers={'Content-Type': 'application/octet-stream', 'content-filename': 'pdf_file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -16,7 +23,7 @@ upload_data_data = f.read() print("Uploading data file...") -upload_data_response = requests.post(url='https://api.pdfrest.com/upload', +upload_data_response = requests.post(url=api_url+'/upload', data=upload_data_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'data_file.xml', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -37,7 +44,7 @@ print("Processing file...") - added_image_response = requests.post(url='https://api.pdfrest.com/pdf-with-imported-form-data', + added_image_response = requests.post(url=api_url+'/pdf-with-imported-form-data', data=json.dumps(added_image_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-ocr-text.py b/Python/Endpoint Examples/JSON Payload/pdf-with-ocr-text.py index cb48f00a..2712d9d2 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-ocr-text.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-ocr-text.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - pdf_with_ocr_text_response = requests.post(url='https://api.pdfrest.com/pdf-with-ocr-text', + pdf_with_ocr_text_response = requests.post(url=api_url+'/pdf-with-ocr-text', data=json.dumps(pdf_with_ocr_text_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.py b/Python/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.py index c706e44e..007e2d3c 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -39,7 +46,7 @@ print("Processing file...") - boxes_response = requests.post(url='https://api.pdfrest.com/pdf-with-page-boxes-set', + boxes_response = requests.post(url=api_url+'/pdf-with-page-boxes-set', data=json.dumps(boxes_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.py b/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.py index 8ff00ec6..6cdb6bfe 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -25,7 +32,7 @@ print("Processing file...") - pdf_with_redacted_text_response = requests.post(url='https://api.pdfrest.com/pdf-with-redacted-text-applied', + pdf_with_redacted_text_response = requests.post(url=api_url+'/pdf-with-redacted-text-applied', data=json.dumps(pdf_with_redacted_text_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -36,9 +43,9 @@ pdf_with_redacted_text_response_json = pdf_with_redacted_text_response.json() print(json.dumps(pdf_with_redacted_text_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -46,7 +53,7 @@ if DELETE_SENSITIVE_FILES: redacted_output_id = pdf_with_redacted_text_response_json['outputId'] delete_data = { "ids": f"{uploaded_id}, {redacted_output_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) if delete_response.ok: diff --git a/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.py b/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.py index 682da527..b9fb676c 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.py +++ b/Python/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -38,7 +45,7 @@ print("Processing file...") - redact_text_response = requests.post(url='https://api.pdfrest.com/pdf-with-redacted-text-preview', + redact_text_response = requests.post(url=api_url+'/pdf-with-redacted-text-preview', data=json.dumps(redact_text_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -49,9 +56,9 @@ redact_text_response_json = redact_text_response.json() print(json.dumps(redact_text_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -61,7 +68,7 @@ preview_id = redact_text_response_json['outputId'] if DELETE_SENSITIVE_FILES: delete_data = { "ids": uploaded_id + ", " + preview_id } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) if delete_response.ok: diff --git a/Python/Endpoint Examples/JSON Payload/pdf.py b/Python/Endpoint Examples/JSON Payload/pdf.py index 90b7b9aa..d9b7d3bf 100644 --- a/Python/Endpoint Examples/JSON Payload/pdf.py +++ b/Python/Endpoint Examples/JSON Payload/pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.png', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - pdf_response = requests.post(url='https://api.pdfrest.com/pdf', + pdf_response = requests.post(url=api_url+'/pdf', data=json.dumps(pdf_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdfa.py b/Python/Endpoint Examples/JSON Payload/pdfa.py index 238ae056..2d9baf92 100644 --- a/Python/Endpoint Examples/JSON Payload/pdfa.py +++ b/Python/Endpoint Examples/JSON Payload/pdfa.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - pdfa_response = requests.post(url='https://api.pdfrest.com/pdfa', + pdfa_response = requests.post(url=api_url+'/pdfa', data=json.dumps(pdfa_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/pdfx.py b/Python/Endpoint Examples/JSON Payload/pdfx.py index f6b84574..f3b5ccd1 100644 --- a/Python/Endpoint Examples/JSON Payload/pdfx.py +++ b/Python/Endpoint Examples/JSON Payload/pdfx.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - pdfx_response = requests.post(url='https://api.pdfrest.com/pdfx', + pdfx_response = requests.post(url=api_url+'/pdfx', data=json.dumps(pdfx_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/png.py b/Python/Endpoint Examples/JSON Payload/png.py index ba73bd7d..05bf5e50 100644 --- a/Python/Endpoint Examples/JSON Payload/png.py +++ b/Python/Endpoint Examples/JSON Payload/png.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - png_response = requests.post(url='https://api.pdfrest.com/png', + png_response = requests.post(url=api_url+'/png', data=json.dumps(png_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/powerpoint.py b/Python/Endpoint Examples/JSON Payload/powerpoint.py index 69b5989e..542e5a99 100644 --- a/Python/Endpoint Examples/JSON Payload/powerpoint.py +++ b/Python/Endpoint Examples/JSON Payload/powerpoint.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - powerpoint_response = requests.post(url='https://api.pdfrest.com/powerpoint', + powerpoint_response = requests.post(url=api_url+'/powerpoint', data=json.dumps(powerpoint_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/rasterized-pdf.py b/Python/Endpoint Examples/JSON Payload/rasterized-pdf.py index 01d63e37..f1300db3 100644 --- a/Python/Endpoint Examples/JSON Payload/rasterized-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/rasterized-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - rasterize_response = requests.post(url='https://api.pdfrest.com/rasterized-pdf', + rasterize_response = requests.post(url=api_url+'/rasterized-pdf', data=json.dumps(rasterize_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/restricted-pdf.py b/Python/Endpoint Examples/JSON Payload/restricted-pdf.py index e0b185c1..97014eed 100644 --- a/Python/Endpoint Examples/JSON Payload/restricted-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/restricted-pdf.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -26,7 +33,7 @@ print("Processing file...") - restrict_response = requests.post(url='https://api.pdfrest.com/restricted-pdf', + restrict_response = requests.post(url=api_url+'/restricted-pdf', data=json.dumps(restrict_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -37,9 +44,9 @@ restrict_response_json = restrict_response.json() print(json.dumps(restrict_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -47,7 +54,7 @@ if DELETE_SENSITIVE_FILES: restricted_output_id = restrict_response_json['outputId'] delete_data = { "ids": f"{uploaded_id}, {restricted_output_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) if delete_response.ok: diff --git a/Python/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.py b/Python/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.py index 9ff1e7e9..6532dfa3 100644 --- a/Python/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.py +++ b/Python/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + def upload_file(file_path, file_name): with open(file_path, 'rb') as f: upload_data = f.read() print("Uploading file...") - upload_response = requests.post(url='https://api.pdfrest.com/upload', + upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': file_name, "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Upload response status code: " + str(upload_response.status_code)) @@ -46,7 +53,7 @@ def upload_file(file_path, file_name): print("Processing file...") -boxes_response = requests.post(url='https://api.pdfrest.com/signed-pdf', +boxes_response = requests.post(url=api_url+'/signed-pdf', data=json.dumps(boxes_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/signed-pdf.py b/Python/Endpoint Examples/JSON Payload/signed-pdf.py index e8b18900..3795ecae 100644 --- a/Python/Endpoint Examples/JSON Payload/signed-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/signed-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + def upload_file(file_path, file_name): with open(file_path, 'rb') as f: upload_data = f.read() print("Uploading file...") - upload_response = requests.post(url='https://api.pdfrest.com/upload', + upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': file_name, "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Upload response status code: " + str(upload_response.status_code)) @@ -55,7 +62,7 @@ def upload_file(file_path, file_name): print("Processing file...") -boxes_response = requests.post(url='https://api.pdfrest.com/signed-pdf', +boxes_response = requests.post(url=api_url+'/signed-pdf', data=json.dumps(boxes_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/split-pdf.py b/Python/Endpoint Examples/JSON Payload/split-pdf.py index f1240093..b633999a 100644 --- a/Python/Endpoint Examples/JSON Payload/split-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/split-pdf.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -23,7 +30,7 @@ print("Processing file...") - split_response = requests.post(url='https://api.pdfrest.com/split-pdf', + split_response = requests.post(url=api_url+'/split-pdf', data=json.dumps(split_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/tif.py b/Python/Endpoint Examples/JSON Payload/tif.py index 8d49dc56..ab9945c2 100644 --- a/Python/Endpoint Examples/JSON Payload/tif.py +++ b/Python/Endpoint Examples/JSON Payload/tif.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - tif_response = requests.post(url='https://api.pdfrest.com/tif', + tif_response = requests.post(url=api_url+'/tif', data=json.dumps(tif_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/unrestricted-pdf.py b/Python/Endpoint Examples/JSON Payload/unrestricted-pdf.py index df222bb8..0d7e27c5 100644 --- a/Python/Endpoint Examples/JSON Payload/unrestricted-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/unrestricted-pdf.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -26,7 +33,7 @@ print("Processing file...") - unrestrict_response = requests.post(url='https://api.pdfrest.com/unrestricted-pdf', + unrestrict_response = requests.post(url=api_url+'/unrestricted-pdf', data=json.dumps(unrestrict_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -37,9 +44,9 @@ unrestrict_response_json = unrestrict_response.json() print(json.dumps(unrestrict_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -47,7 +54,7 @@ if DELETE_SENSITIVE_FILES: result_id = unrestrict_response_json['outputId'] delete_data = { "ids": f"{uploaded_id}, {result_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print(json.dumps(delete_response.json(), indent = 2)) diff --git a/Python/Endpoint Examples/JSON Payload/unzip.py b/Python/Endpoint Examples/JSON Payload/unzip.py index 74b26683..dddbc7ae 100644 --- a/Python/Endpoint Examples/JSON Payload/unzip.py +++ b/Python/Endpoint Examples/JSON Payload/unzip.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read()aaa print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.zip', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - unzip_response = requests.post(url='https://api.pdfrest.com/unzip', + unzip_response = requests.post(url=api_url+'/unzip', data=json.dumps(unzip_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/up-toolkit.py b/Python/Endpoint Examples/JSON Payload/up-toolkit.py index ba27e235..2cb49f69 100644 --- a/Python/Endpoint Examples/JSON Payload/up-toolkit.py +++ b/Python/Endpoint Examples/JSON Payload/up-toolkit.py @@ -1,8 +1,15 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # up-forms and up-office can be used to query the other tools -up_url = f"https://api.pdfrest.com/up-toolkit" +up_url = f"{api_url}/up-toolkit" print("Sending GET request to /up-toolkit endpoint...") response = requests.get(up_url) diff --git a/Python/Endpoint Examples/JSON Payload/upload.py b/Python/Endpoint Examples/JSON Payload/upload.py index fc1a72fe..c72691f7 100644 --- a/Python/Endpoint Examples/JSON Payload/upload.py +++ b/Python/Endpoint Examples/JSON Payload/upload.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/watermarked-pdf.py b/Python/Endpoint Examples/JSON Payload/watermarked-pdf.py index aaf56e26..a20a982c 100644 --- a/Python/Endpoint Examples/JSON Payload/watermarked-pdf.py +++ b/Python/Endpoint Examples/JSON Payload/watermarked-pdf.py @@ -1,6 +1,13 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False @@ -8,7 +15,7 @@ upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -26,7 +33,7 @@ print("Processing file...") - watermark_response = requests.post(url='https://api.pdfrest.com/watermarked-pdf', + watermark_response = requests.post(url=api_url+'/watermarked-pdf', data=json.dumps(watermark_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -37,9 +44,9 @@ watermark_response_json = watermark_response.json() print(json.dumps(watermark_response_json, indent = 2)) - # All files uploaded or generated are automatically deleted based on the - # File Retention Period as shown on https://pdfrest.com/pricing. - # For immediate deletion of files, particularly when sensitive data + # All files uploaded or generated are automatically deleted based on the + # File Retention Period as shown on https://pdfrest.com/pricing. + # For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -47,7 +54,7 @@ if DELETE_SENSITIVE_FILES: watermarked_output_id = watermark_response_json['outputId'] delete_data = { "ids": f"{uploaded_id}, {watermarked_output_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) if delete_response.ok: diff --git a/Python/Endpoint Examples/JSON Payload/word.py b/Python/Endpoint Examples/JSON Payload/word.py index f31e6247..db72e0eb 100644 --- a/Python/Endpoint Examples/JSON Payload/word.py +++ b/Python/Endpoint Examples/JSON Payload/word.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/file', 'rb') as f: upload_data = f.read() print("Uploading file...") -upload_response = requests.post(url='https://api.pdfrest.com/upload', +upload_response = requests.post(url=api_url+'/upload', data=upload_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'file.pdf', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -22,7 +29,7 @@ print("Processing file...") - word_response = requests.post(url='https://api.pdfrest.com/word', + word_response = requests.post(url=api_url+'/word', data=json.dumps(word_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/JSON Payload/zip.py b/Python/Endpoint Examples/JSON Payload/zip.py index a6cc10b9..0e91bc70 100644 --- a/Python/Endpoint Examples/JSON Payload/zip.py +++ b/Python/Endpoint Examples/JSON Payload/zip.py @@ -1,11 +1,18 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + with open('/path/to/first_file', 'rb') as f: # Note that the full file name plus extension needs to be reflected in 'Content-Filename below' upload_first_file_data = f.read() print("Uploading first file...") -upload_first_file_response = requests.post(url='https://api.pdfrest.com/upload', +upload_first_file_response = requests.post(url=api_url+'/upload', data=upload_first_file_data, headers={'Content-Type': 'application/octet-stream', 'Content-Filename': 'first_file', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -16,7 +23,7 @@ upload_second_file_data = f.read() print("Uploading second file...") -upload_second_file_response = requests.post(url='https://api.pdfrest.com/upload', +upload_second_file_response = requests.post(url=api_url+'/upload', data=upload_second_file_data, headers={'Content-Type': 'application/octet-stream', 'content-filename': 'second_file', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) @@ -37,7 +44,7 @@ print("Processing file...") - zip_response = requests.post(url='https://api.pdfrest.com/zip', + zip_response = requests.post(url=api_url+'/zip', data=json.dumps(zip_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) diff --git a/Python/Endpoint Examples/Multipart Payload/batch-delete.py b/Python/Endpoint Examples/Multipart Payload/batch-delete.py index 5b82a4e9..9ccbfd45 100644 --- a/Python/Endpoint Examples/Multipart Payload/batch-delete.py +++ b/Python/Endpoint Examples/Multipart Payload/batch-delete.py @@ -2,7 +2,14 @@ import requests import json -delete_endpoint_url = 'https://api.pdfrest.com/delete' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +delete_endpoint_url = api_url+'/delete' mp_encoder_delete = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/bmp.py b/Python/Endpoint Examples/Multipart Payload/bmp.py index 80ea9dbb..8fb944a7 100644 --- a/Python/Endpoint Examples/Multipart Payload/bmp.py +++ b/Python/Endpoint Examples/Multipart Payload/bmp.py @@ -2,7 +2,14 @@ import requests import json -bmp_endpoint_url = 'https://api.pdfrest.com/bmp' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +bmp_endpoint_url = api_url+'/bmp' # The /bmp endpoint can take a single PDF file or id as input and turn them into BMP image files. # This sample takes in a PDF and converts all pages into grayscale BMP files. diff --git a/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py b/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py index 6fa692d4..9752782e 100644 --- a/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py @@ -2,7 +2,14 @@ import requests import json -compressed_pdf_endpoint_url = 'https://api.pdfrest.com/compressed-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +compressed_pdf_endpoint_url = api_url+'/compressed-pdf' # The /compressed-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates setting compression_level to 'medium'. diff --git a/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py b/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py index 2a823db7..b7103080 100644 --- a/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -decrypted_pdf_endpoint_url = 'https://api.pdfrest.com/decrypted-pdf' +decrypted_pdf_endpoint_url = api_url+'/decrypted-pdf' # The /decrypted-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates decryption of a PDF with the password 'password'. @@ -38,9 +45,9 @@ # If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.py' sample. -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -48,7 +55,7 @@ if DELETE_SENSITIVE_FILES and response.ok: result_id = response_json['outputId'] delete_data = { "ids": f"{response_json['inputId']}, {result_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/delete-resource.py b/Python/Endpoint Examples/Multipart Payload/delete-resource.py index cdefb36e..9134d70e 100644 --- a/Python/Endpoint Examples/Multipart Payload/delete-resource.py +++ b/Python/Endpoint Examples/Multipart Payload/delete-resource.py @@ -1,6 +1,13 @@ import requests -url = "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +url = f"{api_url}/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" payload = {} headers = { diff --git a/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py b/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py index caf99c9c..39dadf27 100644 --- a/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -encrypted_pdf_endpoint_url = 'https://api.pdfrest.com/encrypted-pdf' +encrypted_pdf_endpoint_url = api_url+'/encrypted-pdf' # The /encrypted-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates encryption of a PDF with the password 'password'. @@ -38,16 +45,16 @@ # If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.py' sample. -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. if DELETE_SENSITIVE_FILES and response.ok: delete_data = { "ids": f"{response_json['inputId']}, {response_json['outputId']}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/excel.py b/Python/Endpoint Examples/Multipart Payload/excel.py index e1b5a4af..dbf75d89 100644 --- a/Python/Endpoint Examples/Multipart Payload/excel.py +++ b/Python/Endpoint Examples/Multipart Payload/excel.py @@ -2,7 +2,14 @@ import requests import json -excel_endpoint_url = 'https://api.pdfrest.com/excel' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +excel_endpoint_url = api_url+'/excel' # The /excel endpoint can take a single PDF file or id as input. # This sample demonstrates converting a PDF to an Excel document. diff --git a/Python/Endpoint Examples/Multipart Payload/exported-form-data.py b/Python/Endpoint Examples/Multipart Payload/exported-form-data.py index 11066208..e5a7d2aa 100644 --- a/Python/Endpoint Examples/Multipart Payload/exported-form-data.py +++ b/Python/Endpoint Examples/Multipart Payload/exported-form-data.py @@ -2,7 +2,14 @@ import requests import json -exported_form_data_endpoint_url = 'https://api.pdfrest.com/exported-form-data' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +exported_form_data_endpoint_url = api_url+'/exported-form-data' # The /exported-form-data endpoint can take a single PDF file or id as input. # This sample demonstrates encryption of a PDF with the password 'password'. diff --git a/Python/Endpoint Examples/Multipart Payload/extracted-images.py b/Python/Endpoint Examples/Multipart Payload/extracted-images.py index b1da2374..eb9a2117 100644 --- a/Python/Endpoint Examples/Multipart Payload/extracted-images.py +++ b/Python/Endpoint Examples/Multipart Payload/extracted-images.py @@ -2,7 +2,14 @@ import requests import json -extracted_images_endpoint_url = 'https://api.pdfrest.com/extracted-images' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +extracted_images_endpoint_url = api_url+'/extracted-images' # The /extracted-images endpoint can take a single PDF file or id as input. # This sample demonstrates image extraction from all pages of a document. diff --git a/Python/Endpoint Examples/Multipart Payload/extracted-text.py b/Python/Endpoint Examples/Multipart Payload/extracted-text.py index 15ca8bb5..d68efb94 100644 --- a/Python/Endpoint Examples/Multipart Payload/extracted-text.py +++ b/Python/Endpoint Examples/Multipart Payload/extracted-text.py @@ -2,7 +2,14 @@ import requests import json -extract_text_endpoint_url = 'https://api.pdfrest.com/extracted-text' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +extract_text_endpoint_url = api_url+'/extracted-text' # The /extracted-text endpoint can take a single PDF file or id as input. #This sample demonstrates extracting the text from a document to return as JSON diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py index 1a4e1d1b..25b1dcdd 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py @@ -2,7 +2,14 @@ import requests import json -flattened_annotations_pdf_endpoint_url = 'https://api.pdfrest.com/flattened-annotations-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +flattened_annotations_pdf_endpoint_url = api_url+'/flattened-annotations-pdf' mp_encoder_flattenedPDF = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py index 3c849866..b50fdd5c 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py @@ -2,7 +2,14 @@ import requests import json -flattened_forms_pdf_endpoint_url = 'https://api.pdfrest.com/flattened-forms-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +flattened_forms_pdf_endpoint_url = api_url+'/flattened-forms-pdf' mp_encoder_flattenedPDF = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py index ad88e172..b3a6e153 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py @@ -2,7 +2,14 @@ import requests import json -flattened_layers_pdf_endpoint_url = 'https://api.pdfrest.com/flattened-layers-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +flattened_layers_pdf_endpoint_url = api_url+'/flattened-layers-pdf' mp_encoder_flattenedPDF = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py index 64ff129d..33bde8c9 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py @@ -2,7 +2,14 @@ import requests import json -flatten_transparencies_pdf_endpoint_url = 'https://api.pdfrest.com/flattened-transparencies-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +flatten_transparencies_pdf_endpoint_url = api_url+'/flattened-transparencies-pdf' # The /flattened-transparencies-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates setting quality to 'medium'. diff --git a/Python/Endpoint Examples/Multipart Payload/get-resource.py b/Python/Endpoint Examples/Multipart Payload/get-resource.py index 35ae3ab2..9eba381d 100644 --- a/Python/Endpoint Examples/Multipart Payload/get-resource.py +++ b/Python/Endpoint Examples/Multipart Payload/get-resource.py @@ -1,15 +1,22 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Resource UUIDs can be found in the JSON response of POST requests as "outputId". Resource UUIDs usually look like this: '0950b9bdf-0465-4d3f-8ea3-d2894f1ae839'. id = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place resource uuid here -# The response format can be 'file' or 'url'. +# The response format can be 'file' or 'url'. # If 'url', then JSON containing the url of the resource file is returned. # If 'file', then the file itself is returned. format = 'file' -resource_url = f"https://api.pdfrest.com/resource/{id}?format={format}" +resource_url = f"{api_url}/resource/{id}?format={format}" print("Sending GET request to /resource/{id} endpoint...") response = requests.get(resource_url) diff --git a/Python/Endpoint Examples/Multipart Payload/gif.py b/Python/Endpoint Examples/Multipart Payload/gif.py index fbdf3e4c..5c29289a 100644 --- a/Python/Endpoint Examples/Multipart Payload/gif.py +++ b/Python/Endpoint Examples/Multipart Payload/gif.py @@ -2,7 +2,14 @@ import requests import json -gif_endpoint_url = 'https://api.pdfrest.com/gif' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +gif_endpoint_url = api_url+'/gif' # The /gif endpoint can take a single PDF file or id as input and turn them into GIF image files. # This sample takes in a PDF and converts all pages into grayscale GIF files. diff --git a/Python/Endpoint Examples/Multipart Payload/html.py b/Python/Endpoint Examples/Multipart Payload/html.py index f33835fc..d6f9f75d 100644 --- a/Python/Endpoint Examples/Multipart Payload/html.py +++ b/Python/Endpoint Examples/Multipart Payload/html.py @@ -2,7 +2,14 @@ import requests import json -html_endpoint_url = 'https://api.pdfrest.com/html' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +html_endpoint_url = api_url+'/html' # The /html endpoint can take a string of HTML content and convert it to a HTML (.html) file. # This sample takes in a string of HTML content that displays "Hello World!" and turns it into a HTML file. diff --git a/Python/Endpoint Examples/Multipart Payload/jpg.py b/Python/Endpoint Examples/Multipart Payload/jpg.py index e71a00d3..47e7c20b 100644 --- a/Python/Endpoint Examples/Multipart Payload/jpg.py +++ b/Python/Endpoint Examples/Multipart Payload/jpg.py @@ -2,7 +2,14 @@ import requests import json -jpg_endpoint_url = 'https://api.pdfrest.com/jpg' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +jpg_endpoint_url = api_url+'/jpg' # The /jpg endpoint can take a single PDF file or id as input and turn them into JPEG image files. # This sample takes in a PDF and converts all pages into JPEG files. diff --git a/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py b/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py index 1c0238f6..9bde0f8c 100644 --- a/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py @@ -2,7 +2,14 @@ import requests import json -linearized_pdf_endpoint_url = 'https://api.pdfrest.com/linearized-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +linearized_pdf_endpoint_url = api_url+'/linearized-pdf' # The /linearized-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates linearizing a PDF file. diff --git a/Python/Endpoint Examples/Multipart Payload/markdown.py b/Python/Endpoint Examples/Multipart Payload/markdown.py index fdb69eb0..dc9af8bb 100644 --- a/Python/Endpoint Examples/Multipart Payload/markdown.py +++ b/Python/Endpoint Examples/Multipart Payload/markdown.py @@ -2,7 +2,14 @@ import requests import json -markdown_endpoint_url = 'https://api.pdfrest.com/markdown' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +markdown_endpoint_url = api_url+'/markdown' # The /markdown endpoint can take a single PDF file or id as input. # This sample demonstrates converting the document to markdown and returning it as JSON. @@ -30,4 +37,4 @@ response_json = response.json() print(json.dumps(response_json, indent=2)) else: - print(response.text) \ No newline at end of file + print(response.text) diff --git a/Python/Endpoint Examples/Multipart Payload/merged-pdf.py b/Python/Endpoint Examples/Multipart Payload/merged-pdf.py index 80474bbd..cd05a8e5 100644 --- a/Python/Endpoint Examples/Multipart Payload/merged-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/merged-pdf.py @@ -2,7 +2,14 @@ import requests import json -merged_pdf_endpoint_url = 'https://api.pdfrest.com/merged-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +merged_pdf_endpoint_url = api_url+'/merged-pdf' # The /merged-pdf endpoint can take one or more PDF files or ids as input. # This sample takes 2 PDF files and merges all the pages in the document into a single document. diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-info.py b/Python/Endpoint Examples/Multipart Payload/pdf-info.py index 63b315e2..5f1c8877 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-info.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-info.py @@ -2,7 +2,14 @@ import requests import json -pdf_info_endpoint_url = 'https://api.pdfrest.com/pdf-info' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_info_endpoint_url = api_url+'/pdf-info' # The /pdf-info endpoint can take a single PDF file or id as input. #This sample demonstrates querying the title, page count, document language and author diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-acroforms.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-acroforms.py index fc1b639d..a2329807 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-acroforms.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-acroforms.py @@ -2,7 +2,14 @@ import requests import json -acroform_endpoint_url = 'https://api.pdfrest.com/pdf-with-acroforms' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +acroform_endpoint_url = api_url+'/pdf-with-acroforms' # The /pdf-with-acroforms endpoint can take a single PDF file or id as input. # This sample demonstrates converting an XFA PDF to an acroform document. diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.py index f760ad44..c15dd9b9 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.py @@ -2,7 +2,14 @@ import requests import json -pdf_with_added_attachment_endpoint_url = 'https://api.pdfrest.com/pdf-with-added-attachment' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_with_added_attachment_endpoint_url = api_url+'/pdf-with-added-attachment' mp_encoder_pdfWithAddedAttachment = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py index 56fad3b3..0a99f5d0 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py @@ -2,7 +2,14 @@ import requests import json -pdf_with_added_image_endpoint_url = 'https://api.pdfrest.com/pdf-with-added-image' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_with_added_image_endpoint_url = api_url+'/pdf-with-added-image' mp_encoder_pdfWithAddedImage = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-text.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-text.py index 51d65e6b..6c0f5a59 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-text.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-text.py @@ -2,7 +2,14 @@ import requests import json -pdf_with_added_text_endpoint_url = 'https://api.pdfrest.com/pdf-with-added-text' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_with_added_text_endpoint_url = api_url+'/pdf-with-added-text' text_options = [{ "font":"Times New Roman", diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.py index 42502b08..05acfa45 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.py @@ -2,7 +2,14 @@ import requests import json -pdf_with_converted_colors_endpoint_url = 'https://api.pdfrest.com/pdf-with-converted-colors' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_with_converted_colors_endpoint_url = api_url+'/pdf-with-converted-colors' # The /pdf-with-converted-colors endpoint can take a single PDF file or id as input. # This sample demonstrates setting color_profile to 'srgb'. diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py index 8590bcf6..35e7763a 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py @@ -2,7 +2,14 @@ import requests import json -import_form_data_endpoint_url = 'https://api.pdfrest.com/pdf-with-imported-form-data' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +import_form_data_endpoint_url = api_url+'/pdf-with-imported-form-data' mp_encoder_importFormData = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.py index d51cda96..204c6846 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.py @@ -2,7 +2,14 @@ import requests import json -pdf_with_ocr_text_endpoint_url = 'https://api.pdfrest.com/pdf-with-ocr-text' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_with_ocr_text_endpoint_url = api_url+'/pdf-with-ocr-text' # The /pdf-with-ocr-text endpoint can take a single PDF file or id as input. # This sample demonstrates a request to add text to a document by using OCR on images of text. diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.py index 5a242e21..df6d87b7 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.py @@ -2,7 +2,14 @@ import requests import json -pdf_with_page_boxes_endpoint_url = 'https://api.pdfrest.com/pdf-with-page-boxes-set' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_with_page_boxes_endpoint_url = api_url+'/pdf-with-page-boxes-set' box_options = { "boxes": [ diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.py index 60522b04..b4551222 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -pdf_with_redacted_text_endpoint_url = 'https://api.pdfrest.com/pdf-with-redacted-text-applied' +pdf_with_redacted_text_endpoint_url = api_url+'/pdf-with-redacted-text-applied' # The /pdf-with-redacted-text-applied endpoint can take a single PDF file or id as input. # This sample demonstrates a request to redact text on a document that was processed by /pdf-with-redacted-text-preview @@ -37,16 +44,16 @@ # If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.py' sample. -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. if DELETE_SENSITIVE_FILES and response.ok: delete_data = { "ids": f"{response_json['inputId']}, {response_json['outputId']}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.py index 626bac84..470c14ea 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -pdf_with_redacted_text_endpoint_url = 'https://api.pdfrest.com/pdf-with-redacted-text-preview' +pdf_with_redacted_text_endpoint_url = api_url+'/pdf-with-redacted-text-preview' redaction_options = [{ "type": "preset", @@ -45,9 +52,9 @@ else: print(response.text) -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -56,7 +63,7 @@ # IMPORTANT: Do not delete the outputId (the preview PDF) file until after the redaction is applied # with the /pdf-with-redacted-text-applied endpoint. delete_data = { "ids": response_json['inputId'] + ", " + response_json['outputId'] } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/pdf.py b/Python/Endpoint Examples/Multipart Payload/pdf.py index f21d4142..2422766a 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf.py @@ -2,7 +2,14 @@ import requests import json -pdf_endpoint_url = 'https://api.pdfrest.com/pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdf_endpoint_url = api_url+'/pdf' # The /pdf endpoint can take a single file, id, or url as input. # This sample passes a tif file to the endpoint, but there's a variety of input file types that are accepted by this endpoint. diff --git a/Python/Endpoint Examples/Multipart Payload/pdfa.py b/Python/Endpoint Examples/Multipart Payload/pdfa.py index dc391235..aa9f520d 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdfa.py +++ b/Python/Endpoint Examples/Multipart Payload/pdfa.py @@ -2,7 +2,14 @@ import requests import json -pdfa_endpoint_url = 'https://api.pdfrest.com/pdfa' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdfa_endpoint_url = api_url+'/pdfa' # The /pdfa endpoint can take a single PDF file or id as input. mp_encoder_pdfa = MultipartEncoder( diff --git a/Python/Endpoint Examples/Multipart Payload/pdfx.py b/Python/Endpoint Examples/Multipart Payload/pdfx.py index ef2aa6f6..c6b70351 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdfx.py +++ b/Python/Endpoint Examples/Multipart Payload/pdfx.py @@ -2,7 +2,14 @@ import requests import json -pdfx_endpoint_url = 'https://api.pdfrest.com/pdfx' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +pdfx_endpoint_url = api_url+'/pdfx' # The /pdfx endpoint can take a single PDF file or id as input. mp_encoder_pdfx = MultipartEncoder( diff --git a/Python/Endpoint Examples/Multipart Payload/png.py b/Python/Endpoint Examples/Multipart Payload/png.py index 6f6600f9..64658fc7 100644 --- a/Python/Endpoint Examples/Multipart Payload/png.py +++ b/Python/Endpoint Examples/Multipart Payload/png.py @@ -2,7 +2,14 @@ import requests import json -png_endpoint_url = 'https://api.pdfrest.com/png' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +png_endpoint_url = api_url+'/png' # The /png endpoint can take a single PDF file or id as input and turn them into PNG image files. # This sample takes in a PDF and converts all pages into grayscale PNG files. diff --git a/Python/Endpoint Examples/Multipart Payload/powerpoint.py b/Python/Endpoint Examples/Multipart Payload/powerpoint.py index a807e387..f668d6b8 100644 --- a/Python/Endpoint Examples/Multipart Payload/powerpoint.py +++ b/Python/Endpoint Examples/Multipart Payload/powerpoint.py @@ -2,7 +2,14 @@ import requests import json -powerpoint_endpoint_url = 'https://api.pdfrest.com/powerpoint' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +powerpoint_endpoint_url = api_url+'/powerpoint' # The /powerpoint endpoint can take a single PDF file or id as input. # This sample demonstrates converting a PDF to a PowerPoint document. diff --git a/Python/Endpoint Examples/Multipart Payload/rasterized-pdf.py b/Python/Endpoint Examples/Multipart Payload/rasterized-pdf.py index eb64edd6..96ea94eb 100644 --- a/Python/Endpoint Examples/Multipart Payload/rasterized-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/rasterized-pdf.py @@ -2,7 +2,14 @@ import requests import json -rasterize_endpoint_url = 'https://api.pdfrest.com/rasterized-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +rasterize_endpoint_url = api_url+'/rasterized-pdf' # The /rasterized endpoint can take a single PDF file or id as input and turn it into a rasterized PDF file. mp_encoder_rasterize = MultipartEncoder( diff --git a/Python/Endpoint Examples/Multipart Payload/request-status.py b/Python/Endpoint Examples/Multipart Payload/request-status.py index 7082de10..5aca258c 100644 --- a/Python/Endpoint Examples/Multipart Payload/request-status.py +++ b/Python/Endpoint Examples/Multipart Payload/request-status.py @@ -3,9 +3,16 @@ import json import time +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + api_key = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # place your api key here -pdfa_endpoint_url = 'https://api.pdfrest.com/pdfa' +pdfa_endpoint_url = api_url+'/pdfa' mp_encoder_pdfa = MultipartEncoder( fields={ @@ -29,9 +36,9 @@ if response.ok: - response_json = response.json() + response_json = response.json() request_id = response_json["requestId"] - api_polling_endpoint_url = f'https://api.pdfrest.com/request-status/{request_id}' + api_polling_endpoint_url = f'{api_url}/request-status/{request_id}' headers = { 'Api-Key': api_key diff --git a/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py b/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py index 890887d5..24e88dff 100644 --- a/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -restricted_pdf_endpoint_url = 'https://api.pdfrest.com/restricted-pdf' +restricted_pdf_endpoint_url = api_url+'/restricted-pdf' # The /restricted-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates setting the permissions password to 'password' and adding restrictions. @@ -41,16 +48,16 @@ # If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.py' sample. -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. if DELETE_SENSITIVE_FILES and response.ok: delete_data = { "ids": f"{response_json['inputId']}, {response_json['outputId']}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.py b/Python/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.py index eaa13cfb..d70b7352 100644 --- a/Python/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.py +++ b/Python/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.py @@ -2,7 +2,14 @@ import requests import json -signed_pdf_endpoint_url = 'https://api.pdfrest.com/signed-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +signed_pdf_endpoint_url = api_url+'/signed-pdf' signature_config = { "type": "new", diff --git a/Python/Endpoint Examples/Multipart Payload/signed-pdf.py b/Python/Endpoint Examples/Multipart Payload/signed-pdf.py index 92d3fb85..e56c6afc 100644 --- a/Python/Endpoint Examples/Multipart Payload/signed-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/signed-pdf.py @@ -2,7 +2,14 @@ import requests import json -signed_pdf_endpoint_url = 'https://api.pdfrest.com/signed-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +signed_pdf_endpoint_url = api_url+'/signed-pdf' signature_config = { "type": "new", diff --git a/Python/Endpoint Examples/Multipart Payload/split-pdf.py b/Python/Endpoint Examples/Multipart Payload/split-pdf.py index f6d402bc..d556d044 100644 --- a/Python/Endpoint Examples/Multipart Payload/split-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/split-pdf.py @@ -2,7 +2,14 @@ import requests import json -split_pdf_endpoint_url = 'https://api.pdfrest.com/split-pdf' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +split_pdf_endpoint_url = api_url+'/split-pdf' # The /split-pdf endpoint can take one PDF file or id as input. # This sample takes one PDF file that has at least 5 pages and splits it into two documents when given two page ranges. diff --git a/Python/Endpoint Examples/Multipart Payload/tif.py b/Python/Endpoint Examples/Multipart Payload/tif.py index 3a992028..f23e9526 100644 --- a/Python/Endpoint Examples/Multipart Payload/tif.py +++ b/Python/Endpoint Examples/Multipart Payload/tif.py @@ -2,7 +2,14 @@ import requests import json -tif_endpoint_url = 'https://api.pdfrest.com/tif' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +tif_endpoint_url = api_url+'/tif' # The /tif endpoint can take a single PDF file or id as input and turn them into TIFF image files. # This sample takes in a PDF and converts all pages into grayscale TIFF files. diff --git a/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py b/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py index b9580af3..19354b3f 100644 --- a/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -unrestricted_pdf_endpoint_url = 'https://api.pdfrest.com/unrestricted-pdf' +unrestricted_pdf_endpoint_url = api_url+'/unrestricted-pdf' # The /unrestricted-pdf endpoint can take a single PDF file or id as input. # This sample demonstrates removing security restrictions from a PDF. @@ -38,9 +45,9 @@ # If you would like to download the file instead of getting the JSON response, please see the 'get-resource-id-endpoint.py' sample. -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. @@ -48,7 +55,7 @@ result_id = response_json['outputId'] if DELETE_SENSITIVE_FILES and response.ok: delete_data = { "ids": f"{response_json['inputId']}, {result_id}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/unzip.py b/Python/Endpoint Examples/Multipart Payload/unzip.py index 8ebeae18..e052353e 100644 --- a/Python/Endpoint Examples/Multipart Payload/unzip.py +++ b/Python/Endpoint Examples/Multipart Payload/unzip.py @@ -2,7 +2,14 @@ import requests import json -unzip_endpoint_url = 'https://api.pdfrest.com/unzip' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +unzip_endpoint_url = api_url+'/unzip' mp_encoder_unzip = MultipartEncoder( fields={ diff --git a/Python/Endpoint Examples/Multipart Payload/up-toolkit.py b/Python/Endpoint Examples/Multipart Payload/up-toolkit.py index ba27e235..2cb49f69 100644 --- a/Python/Endpoint Examples/Multipart Payload/up-toolkit.py +++ b/Python/Endpoint Examples/Multipart Payload/up-toolkit.py @@ -1,8 +1,15 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # up-forms and up-office can be used to query the other tools -up_url = f"https://api.pdfrest.com/up-toolkit" +up_url = f"{api_url}/up-toolkit" print("Sending GET request to /up-toolkit endpoint...") response = requests.get(up_url) diff --git a/Python/Endpoint Examples/Multipart Payload/upload.py b/Python/Endpoint Examples/Multipart Payload/upload.py index 60bb3a1b..448453ad 100644 --- a/Python/Endpoint Examples/Multipart Payload/upload.py +++ b/Python/Endpoint Examples/Multipart Payload/upload.py @@ -2,7 +2,14 @@ import requests import json -upload_endpoint_url = 'https://api.pdfrest.com/upload' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +upload_endpoint_url = api_url+'/upload' # The /upload endpoint can take one or more files or urls as input and transfers them to the pdfRest server for processing. # This sample takes 3 files and uploads it to the pdfRest service. diff --git a/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py b/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py index b8a347c5..80e59949 100644 --- a/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py @@ -2,10 +2,17 @@ import requests import json +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + # Toggle deletion of sensitive files (default: False) DELETE_SENSITIVE_FILES = False -watermarked_pdf_endpoint_url = 'https://api.pdfrest.com/watermarked-pdf' +watermarked_pdf_endpoint_url = api_url+'/watermarked-pdf' mp_encoder_watermarkedPDF = MultipartEncoder( fields={ @@ -32,16 +39,16 @@ else: print(response.text) -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # # Deletes all files in the workflow, including outputs. Save all desired files before enabling this step. if DELETE_SENSITIVE_FILES and response.ok: delete_data = { "ids": f"{response_json['inputId'][0]}, {response_json['outputId']}" } - delete_response = requests.post(url='https://api.pdfrest.com/delete', + delete_response = requests.post(url=api_url+'/delete', data=json.dumps(delete_data), headers={'Content-Type': 'application/json', "API-Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}) print("Delete response status code: " + str(delete_response.status_code)) diff --git a/Python/Endpoint Examples/Multipart Payload/word.py b/Python/Endpoint Examples/Multipart Payload/word.py index b6530d3f..35635a15 100644 --- a/Python/Endpoint Examples/Multipart Payload/word.py +++ b/Python/Endpoint Examples/Multipart Payload/word.py @@ -2,7 +2,14 @@ import requests import json -word_endpoint_url = 'https://api.pdfrest.com/word' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +word_endpoint_url = api_url+'/word' # The /word endpoint can take a single PDF file or id as input. # This sample demonstrates converting a PDF to a Word document. diff --git a/Python/Endpoint Examples/Multipart Payload/zip.py b/Python/Endpoint Examples/Multipart Payload/zip.py index 066ee9d6..4e00c38c 100644 --- a/Python/Endpoint Examples/Multipart Payload/zip.py +++ b/Python/Endpoint Examples/Multipart Payload/zip.py @@ -2,7 +2,14 @@ import requests import json -zip_endpoint_url = 'https://api.pdfrest.com/zip' +# By default, we use the US-based API service. This is the primary endpoint for global use. +api_url = "https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +#api_url = "https://eu-api.pdfrest.com" + +zip_endpoint_url = api_url+'/zip' # The /zip endpoint can take one or more file or ids as input and compresses them into a .zip. # This sample takes 2 files and compresses them into a zip file. diff --git a/cURL/Complex Flow Examples/decrypt-add-reencrypt.sh b/cURL/Complex Flow Examples/decrypt-add-reencrypt.sh index bcb64614..99c61fcf 100755 --- a/cURL/Complex Flow Examples/decrypt-add-reencrypt.sh +++ b/cURL/Complex Flow Examples/decrypt-add-reencrypt.sh @@ -8,9 +8,16 @@ # and then sending the output with the new image through /encrypted-pdf to # lock it up again. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # place your api key here -DECRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/decrypted-pdf" \ +DECRYPTED_OUTPUT=$(curl -X POST "$API_URL/decrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -21,12 +28,12 @@ DECRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/decrypted-pdf" \ DECRYPTED_ID=$(jq -r '.outputId' <<< $DECRYPTED_OUTPUT) -ADDED_IMAGE_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-added-image" \ +ADDED_IMAGE_OUTPUT=$(curl -X POST "$API_URL/pdf-with-added-image" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ -F "id=$DECRYPTED_ID" \ - -F "image_file=@/path/to/image.png" \ + -F "image_file=@/path/to/file.png" \ -F "output=example_out" \ -F "x=10" \ -F "y=10" \ @@ -35,7 +42,7 @@ ADDED_IMAGE_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-added-image" ADDED_IMAGE_ID=$(jq -r '.outputId' <<< $ADDED_IMAGE_OUTPUT) -ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ +ENCRYPTED_OUTPUT=$(curl -X POST "$API_URL/encrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -46,9 +53,9 @@ ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -59,7 +66,7 @@ if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $DECRYPTED_OUTPUT) ADDED_IMAGE_INPUTS=$(jq -r '.inputId | join(",")' <<< $ADDED_IMAGE_OUTPUT) # Includes the DECRYPTED_ID REENCRYPTED_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ diff --git a/cURL/Complex Flow Examples/merge-different-file-types.sh b/cURL/Complex Flow Examples/merge-different-file-types.sh index cf62cf64..0eca0672 100755 --- a/cURL/Complex Flow Examples/merge-different-file-types.sh +++ b/cURL/Complex Flow Examples/merge-different-file-types.sh @@ -11,9 +11,16 @@ # this sample could be easily used to convert and combine any two file types # that the /pdf route takes as inputs. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # place your api key here -IMAGE_ID=$(curl -X POST "https://api.pdfrest.com/pdf" \ +IMAGE_ID=$(curl -X POST "$API_URL/pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -22,7 +29,7 @@ IMAGE_ID=$(curl -X POST "https://api.pdfrest.com/pdf" \ | jq -r '.outputId') -PPT_ID=$(curl -X POST "https://api.pdfrest.com/pdf" \ +PPT_ID=$(curl -X POST "$API_URL/pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -31,7 +38,7 @@ PPT_ID=$(curl -X POST "https://api.pdfrest.com/pdf" \ | jq -r '.outputId') -curl -X POST "https://api.pdfrest.com/merged-pdf" \ +curl -X POST "$API_URL/merged-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ diff --git a/cURL/Complex Flow Examples/ocr-with-extract-text.sh b/cURL/Complex Flow Examples/ocr-with-extract-text.sh index ccee7c08..3ad26dd8 100755 --- a/cURL/Complex Flow Examples/ocr-with-extract-text.sh +++ b/cURL/Complex Flow Examples/ocr-with-extract-text.sh @@ -8,10 +8,17 @@ # output ID. Then, we will send the output ID to the /extracted-text route, which will # return the newly added text. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # Replace with your API key # Upload PDF for OCR -OCR_PDF_ID=$(curl -s -X POST "https://api.pdfrest.com/pdf-with-ocr-text" \ +OCR_PDF_ID=$(curl -s -X POST "$API_URL/pdf-with-ocr-text" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -21,7 +28,7 @@ OCR_PDF_ID=$(curl -s -X POST "https://api.pdfrest.com/pdf-with-ocr-text" \ # Extract text from OCR'd PDF -EXTRACT_TEXT_RESPONSE=$(curl -s -X POST "https://api.pdfrest.com/extracted-text" \ +EXTRACT_TEXT_RESPONSE=$(curl -s -X POST "$API_URL/extracted-text" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -29,4 +36,4 @@ EXTRACT_TEXT_RESPONSE=$(curl -s -X POST "https://api.pdfrest.com/extracted-text" FULL_TEXT=$(echo $EXTRACT_TEXT_RESPONSE | jq -r '.fullText') -echo "Extracted text: $FULL_TEXT" \ No newline at end of file +echo "Extracted text: $FULL_TEXT" diff --git a/cURL/Complex Flow Examples/pdfa-3b-with-attachment.sh b/cURL/Complex Flow Examples/pdfa-3b-with-attachment.sh index 11c9ccf9..d5ebdd51 100755 --- a/cURL/Complex Flow Examples/pdfa-3b-with-attachment.sh +++ b/cURL/Complex Flow Examples/pdfa-3b-with-attachment.sh @@ -9,9 +9,16 @@ # Note that there is nothing special about attaching an xml file, and any appropriate # file may be attached and wrapped into the PDF/A conversion. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # place your api key here -ATTACHED_ID=$(curl -X POST "https://api.pdfrest.com/pdf-with-added-attachment" \ +ATTACHED_ID=$(curl -X POST "$API_URL/pdf-with-added-attachment" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -20,7 +27,7 @@ ATTACHED_ID=$(curl -X POST "https://api.pdfrest.com/pdf-with-added-attachment" \ -F "output=example_out" \ | jq -r '.outputId') -curl -X POST "https://api.pdfrest.com/pdfa" \ +curl -X POST "$API_URL/pdfa" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ diff --git a/cURL/Complex Flow Examples/preserve-word-document.sh b/cURL/Complex Flow Examples/preserve-word-document.sh index 801e9d6f..7c33d820 100755 --- a/cURL/Complex Flow Examples/preserve-word-document.sh +++ b/cURL/Complex Flow Examples/preserve-word-document.sh @@ -6,16 +6,23 @@ # a PDF with a call to the /pdf route. Then, we will take that converted PDF # and convert it to the PDF/A format for long-term storage. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # place your api key here -PDF_ID=$(curl -X POST "https://api.pdfrest.com/pdf" \ +PDF_ID=$(curl -X POST "$API_URL/pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ -F "file=@/path/to/file.doc" \ | jq -r '.outputId') -curl -X POST "https://api.pdfrest.com/pdfa" \ +curl -X POST "$API_URL/pdfa" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ diff --git a/cURL/Complex Flow Examples/protected-watermark.sh b/cURL/Complex Flow Examples/protected-watermark.sh index 68347920..8f3af36e 100755 --- a/cURL/Complex Flow Examples/protected-watermark.sh +++ b/cURL/Complex Flow Examples/protected-watermark.sh @@ -6,10 +6,16 @@ # We will be running the input file through /watermarked-pdf to apply the watermark # and then /restricted-pdf to lock the watermark in. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # place your api key here -WATERMARKED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/watermarked-pdf" \ +WATERMARKED_OUTPUT=$(curl -X POST "$API_URL/watermarked-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -21,7 +27,7 @@ WATERMARKED_ID=$(jq -r '.outputId' <<< $WATERMARKED_OUTPUT) echo $WATERMARKED_OUTPUT | jq -r '.' -RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ +RESTRICTED_OUTPUT=$(curl -X POST "$API_URL/restricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -34,9 +40,9 @@ RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -46,7 +52,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId[0]' <<< $WATERMARKED_OUTPUT) RESTRICTED_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ diff --git a/cURL/Complex Flow Examples/redact-preview-and-finalize.sh b/cURL/Complex Flow Examples/redact-preview-and-finalize.sh index c97ff592..d7ef53dd 100644 --- a/cURL/Complex Flow Examples/redact-preview-and-finalize.sh +++ b/cURL/Complex Flow Examples/redact-preview-and-finalize.sh @@ -6,9 +6,16 @@ # the preview stage before utilizing this workflow to ensure that content is # redacted as intended. +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # place your api key here REDACTIONS='[{"type":"regex","value":"[Tt]he"}]' -PREVIEW_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-preview" \ +PREVIEW_OUTPUT=$(curl -X POST "$API_URL/pdf-with-redacted-text-preview" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -20,7 +27,7 @@ PREVIEW_PDF_ID=$(jq -r '.outputId' <<< $PREVIEW_OUTPUT) echo $PREVIEW_OUTPUT | jq -r '.' -APPLIED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-applied" \ +APPLIED_OUTPUT=$(curl -X POST "$API_URL/pdf-with-redacted-text-applied" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -29,9 +36,9 @@ APPLIED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-ap echo $APPLIED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -41,7 +48,7 @@ echo $APPLIED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $PREVIEW_OUTPUT) APPLIED_PDF_ID=$(jq -r '.outputId' <<< $APPLIED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ diff --git a/cURL/Endpoint Examples/JSON Payload/batch-delete.sh b/cURL/Endpoint Examples/JSON Payload/batch-delete.sh index 5e101252..a0049baa 100755 --- a/cURL/Endpoint Examples/JSON Payload/batch-delete.sh +++ b/cURL/Endpoint Examples/JSON Payload/batch-delete.sh @@ -1,5 +1,13 @@ #!/bin/sh -curl --request POST "https://api.pdfrest.com/delete" \ + +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/bmp.sh b/cURL/Endpoint Examples/JSON Payload/bmp.sh index ad2b4d86..f7de83ec 100755 --- a/cURL/Endpoint Examples/JSON Payload/bmp.sh +++ b/cURL/Endpoint Examples/JSON Payload/bmp.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/bmp' \ +curl "$API_URL/bmp" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/compressed-pdf.sh b/cURL/Endpoint Examples/JSON Payload/compressed-pdf.sh index 4c150fc0..c285d3e1 100755 --- a/cURL/Endpoint Examples/JSON Payload/compressed-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/compressed-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/compressed-pdf' \ +curl "$API_URL/compressed-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"compression_level\": \"medium\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/decrypted-pdf-with-permissions-password.sh b/cURL/Endpoint Examples/JSON Payload/decrypted-pdf-with-permissions-password.sh index eeaf6367..057563ac 100755 --- a/cURL/Endpoint Examples/JSON Payload/decrypted-pdf-with-permissions-password.sh +++ b/cURL/Endpoint Examples/JSON Payload/decrypted-pdf-with-permissions-password.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -DECRYPTED_OUTPUT=$(curl 'https://api.pdfrest.com/decrypted-pdf' \ +DECRYPTED_OUTPUT=$(curl "$API_URL/decrypted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_open_password\": \"encrypted\", \"current_permissions_password\": \"restricted\"}") echo $DECRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -27,7 +34,7 @@ echo $DECRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then DECRYPTED_ID=$(jq -r '.outputId' <<< $DECRYPTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $DECRYPTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$INPUT_PDF_ID, $DECRYPTED_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/decrypted-pdf.sh b/cURL/Endpoint Examples/JSON Payload/decrypted-pdf.sh index 4ce18ed6..cea56c87 100755 --- a/cURL/Endpoint Examples/JSON Payload/decrypted-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/decrypted-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -DECRYPTED_OUTPUT=$(curl 'https://api.pdfrest.com/decrypted-pdf' \ +DECRYPTED_OUTPUT=$(curl "$API_URL/decrypted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_open_password\": \"encrypted\"}") echo $DECRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -27,7 +34,7 @@ echo $DECRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then DECRYPTED_ID=$(jq -r '.outputId' <<< $DECRYPTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $DECRYPTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$INPUT_PDF_ID, $DECRYPTED_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/delete-resource.sh b/cURL/Endpoint Examples/JSON Payload/delete-resource.sh index 99b83f9c..83975ddb 100755 --- a/cURL/Endpoint Examples/JSON Payload/delete-resource.sh +++ b/cURL/Endpoint Examples/JSON Payload/delete-resource.sh @@ -1,3 +1,11 @@ #!/bin/sh -curl --request DELETE "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ + +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl --request DELETE "$API_URL/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ diff --git a/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-change-password.sh b/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-change-password.sh index 029743a9..b0f1f2cd 100755 --- a/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-change-password.sh +++ b/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-change-password.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -ENCRYPTED_OUTPUT=$(curl 'https://api.pdfrest.com/encrypted-pdf' \ +ENCRYPTED_OUTPUT=$(curl "$API_URL/encrypted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_open_password\": \"password\", \"new_open_password\": \"new_password\"}") echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $ENCRYPTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then ENCRYPTED_OUTPUT_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $ENCRYPTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-new-password-with-permissions-password.sh b/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-new-password-with-permissions-password.sh index 7408897b..9bcc2dac 100755 --- a/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-new-password-with-permissions-password.sh +++ b/cURL/Endpoint Examples/JSON Payload/encrypted-pdf-new-password-with-permissions-password.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -ENCRYPTED_OUTPUT=$(curl 'https://api.pdfrest.com/encrypted-pdf' \ +ENCRYPTED_OUTPUT=$(curl "$API_URL/encrypted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_permissions_password\": \"password\", \"new_open_password\": \"new_password\"}") echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $ENCRYPTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then ENCRYPTED_OUTPUT_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $ENCRYPTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/encrypted-pdf.sh b/cURL/Endpoint Examples/JSON Payload/encrypted-pdf.sh index a721af92..9685cf41 100755 --- a/cURL/Endpoint Examples/JSON Payload/encrypted-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/encrypted-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -ENCRYPTED_OUTPUT=$(curl 'https://api.pdfrest.com/encrypted-pdf' \ +ENCRYPTED_OUTPUT=$(curl "$API_URL/encrypted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"new_open_password\": \"new_password\"}") echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $ENCRYPTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then ENCRYPTED_OUTPUT_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $ENCRYPTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/excel.sh b/cURL/Endpoint Examples/JSON Payload/excel.sh index 3da1a00d..982e7e44 100644 --- a/cURL/Endpoint Examples/JSON Payload/excel.sh +++ b/cURL/Endpoint Examples/JSON Payload/excel.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/excel' \ +curl "$API_URL/excel" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/exported-form-data.sh b/cURL/Endpoint Examples/JSON Payload/exported-form-data.sh index 79664060..a2622bb8 100755 --- a/cURL/Endpoint Examples/JSON Payload/exported-form-data.sh +++ b/cURL/Endpoint Examples/JSON Payload/exported-form-data.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/exported-form-data' \ +curl "$API_URL/exported-form-data" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"data_format\": \"xml\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/extracted-images.sh b/cURL/Endpoint Examples/JSON Payload/extracted-images.sh index bceb178a..594ca7a0 100755 --- a/cURL/Endpoint Examples/JSON Payload/extracted-images.sh +++ b/cURL/Endpoint Examples/JSON Payload/extracted-images.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/extracted-images' \ +curl "$API_URL/extracted-images" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"pages\": \"1-last\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/extracted-text.sh b/cURL/Endpoint Examples/JSON Payload/extracted-text.sh index 25b48998..884eb7c3 100755 --- a/cURL/Endpoint Examples/JSON Payload/extracted-text.sh +++ b/cURL/Endpoint Examples/JSON Payload/extracted-text.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/extracted-text' \ +curl "$API_URL/extracted-text" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/flattened-annotations-pdf.sh b/cURL/Endpoint Examples/JSON Payload/flattened-annotations-pdf.sh index 0a8febaa..7a1fd9d1 100755 --- a/cURL/Endpoint Examples/JSON Payload/flattened-annotations-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/flattened-annotations-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/flattened-annotations-pdf' \ +curl "$API_URL/flattened-annotations-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/flattened-forms-pdf.sh b/cURL/Endpoint Examples/JSON Payload/flattened-forms-pdf.sh index 81634255..22f87f5d 100755 --- a/cURL/Endpoint Examples/JSON Payload/flattened-forms-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/flattened-forms-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/flattened-forms-pdf' \ +curl "$API_URL/flattened-forms-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/flattened-layers-pdf.sh b/cURL/Endpoint Examples/JSON Payload/flattened-layers-pdf.sh index 0ced1618..c1274446 100755 --- a/cURL/Endpoint Examples/JSON Payload/flattened-layers-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/flattened-layers-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/flattened-layers-pdf' \ +curl "$API_URL/flattened-layers-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf-medium.sh b/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf-medium.sh index 36af1127..a87b1572 100755 --- a/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf-medium.sh +++ b/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf-medium.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/flattened-transparencies-pdf' \ +curl "$API_URL/flattened-transparencies-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"quality\": \"medium\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.sh b/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.sh index 9d925c7b..4434dd40 100755 --- a/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/flattened-transparencies-pdf' \ +curl "$API_URL/flattened-transparencies-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/get-resource.sh b/cURL/Endpoint Examples/JSON Payload/get-resource.sh index fddd19dc..4a4169c1 100755 --- a/cURL/Endpoint Examples/JSON Payload/get-resource.sh +++ b/cURL/Endpoint Examples/JSON Payload/get-resource.sh @@ -1 +1,8 @@ -curl -X GET "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url" +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X GET "$API_URL/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url" diff --git a/cURL/Endpoint Examples/JSON Payload/gif.sh b/cURL/Endpoint Examples/JSON Payload/gif.sh index bfaf04f3..dbc46afd 100755 --- a/cURL/Endpoint Examples/JSON Payload/gif.sh +++ b/cURL/Endpoint Examples/JSON Payload/gif.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/gif' \ +curl "$API_URL/gif" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/jpg.sh b/cURL/Endpoint Examples/JSON Payload/jpg.sh index 253f7aba..50c7be01 100755 --- a/cURL/Endpoint Examples/JSON Payload/jpg.sh +++ b/cURL/Endpoint Examples/JSON Payload/jpg.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/jpg' \ +curl "$API_URL/jpg" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/linearized-pdf.sh b/cURL/Endpoint Examples/JSON Payload/linearized-pdf.sh index a9272637..6f1c8b80 100755 --- a/cURL/Endpoint Examples/JSON Payload/linearized-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/linearized-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/linearized-pdf' \ +curl "$API_URL/linearized-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/markdown.sh b/cURL/Endpoint Examples/JSON Payload/markdown.sh index e78cf293..35f9b8ac 100644 --- a/cURL/Endpoint Examples/JSON Payload/markdown.sh +++ b/cURL/Endpoint Examples/JSON Payload/markdown.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/markdown' \ +curl "$API_URL/markdown" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/merged-pdf.sh b/cURL/Endpoint Examples/JSON Payload/merged-pdf.sh index 187eb638..ed311275 100755 --- a/cURL/Endpoint Examples/JSON Payload/merged-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/merged-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_FIRST_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_FIRST_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: first_filename.pdf' \ --data-binary '@/path/to/first_file' \ @@ -8,7 +15,7 @@ UPLOAD_FIRST_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "First file successfully uploaded with an ID of: $UPLOAD_FIRST_FILE_ID" -UPLOAD_SECOND_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +UPLOAD_SECOND_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: second_filename.pdf' \ --data-binary '@/path/to/second_file' \ @@ -16,7 +23,7 @@ UPLOAD_SECOND_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Second file successfully uploaded with an ID of: $UPLOAD_SECOND_FILE_ID" -curl 'https://api.pdfrest.com/merged-pdf' \ +curl "$API_URL/merged-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": [\"$UPLOAD_FIRST_FILE_ID\", \"$UPLOAD_SECOND_FILE_ID\"], \"pages\":[1,1], \"type\":[\"id\", \"id\"] }" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-html-to-pdf.sh b/cURL/Endpoint Examples/JSON Payload/pdf-html-to-pdf.sh index ef5f39b0..1c996e65 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-html-to-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-html-to-pdf.sh @@ -1,4 +1,12 @@ -curl 'https://api.pdfrest.com/pdf' \ + +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl "$API_URL/pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ "url": "https://pdfrest.com/"}' | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-info.sh b/cURL/Endpoint Examples/JSON Payload/pdf-info.sh index 4c8cd26a..66d621bb 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-info.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-info.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdf-info' \ +curl "$API_URL/pdf-info" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"queries\": \"title,page_count,doc_language,author\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-acroforms.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-acroforms.sh index d86dac1e..b448816a 100644 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-acroforms.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-acroforms.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdf-with-acroforms' \ +curl "$API_URL/pdf-with-acroforms" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-added-attachment.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-added-attachment.sh index 55819fad..e85f927e 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-added-attachment.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-added-attachment.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_PDF_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/pdf_file' \ @@ -8,7 +15,7 @@ UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" -UPLOAD_ATTACHMENT_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +UPLOAD_ATTACHMENT_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.xml' \ --data-binary '@/path/to/attachment_file' \ @@ -16,7 +23,7 @@ UPLOAD_ATTACHMENT_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Attachment file successfully uploaded with an ID of: $UPLOAD_ATTACHMENT_FILE_ID" -curl 'https://api.pdfrest.com/pdf-with-added-attachment' \ +curl "$API_URL/pdf-with-added-attachment" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_PDF_FILE_ID\", \"id_to_attach\": \"$UPLOAD_ATTACHMENT_FILE_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-added-image.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-added-image.sh index 9e23a3f8..ad52426d 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-added-image.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-added-image.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_PDF_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/pdf_file' \ @@ -8,7 +15,7 @@ UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" -UPLOAD_IMAGE_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +UPLOAD_IMAGE_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.png' \ --data-binary '@/path/to/image_file' \ @@ -16,7 +23,7 @@ UPLOAD_IMAGE_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Image file successfully uploaded with an ID of: $UPLOAD_IMAGE_FILE_ID" -curl 'https://api.pdfrest.com/pdf-with-added-image' \ +curl "$API_URL/pdf-with-added-image" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_PDF_FILE_ID\", \"image_id\": \"$UPLOAD_IMAGE_FILE_ID\", \"page\":1, \"x\":0, \"y\":0 }" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-added-text.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-added-text.sh index 949fb181..8b1e49a9 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-added-text.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-added-text.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -10,7 +17,7 @@ echo "File successfully uploaded with an ID of: $UPLOAD_ID" TEXT_OPTIONS='[{\"font\":\"Times New Roman\",\"max_width\":\"175\",\"opacity\":\"1\",\"page\":\"1\",\"rotation\":\"0\",\"text\":\"sample text in PDF\",\"text_color_rgb\":\"0,0,0\",\"text_size\":\"30\",\"x\":\"72\",\"y\":\"144\"}]' -curl 'https://api.pdfrest.com/pdf-with-added-text' \ +curl "$API_URL/pdf-with-added-text" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"text_objects\": \"$TEXT_OPTIONS\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-converted-colors.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-converted-colors.sh index f3c818d9..72566b6b 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-converted-colors.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-converted-colors.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdf-with-converted-colors' \ +curl "$API_URL/pdf-with-converted-colors" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"color_profile\": \"srgb\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.sh index 0b5a2746..7f39d260 100644 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_PDF_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/pdf_file' \ @@ -8,7 +15,7 @@ UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" -UPLOAD_DATA_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +UPLOAD_DATA_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.xml' \ --data-binary '@/path/to/data_file' \ @@ -16,7 +23,7 @@ UPLOAD_DATA_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Data file successfully uploaded with an ID of: $UPLOAD_DATA_FILE_ID" -curl 'https://api.pdfrest.com/pdf-with-imported-form-data' \ +curl "$API_URL/pdf-with-imported-form-data" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_PDF_FILE_ID\", \"data_file_id\": \"$UPLOAD_DATA_FILE_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-ocr-text.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-ocr-text.sh index 72917391..06f47402 100644 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-ocr-text.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-ocr-text.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdf-with-ocr-text' \ +curl "$API_URL/pdf-with-ocr-text" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.sh index 308785e0..15402008 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-page-boxes-set.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -10,7 +17,7 @@ echo "File successfully uploaded with an ID of: $UPLOAD_ID" BOXES='{"boxes":[{"box":"media","pages":[{"range":"1","left":100,"top":100,"bottom":100,"right":100}]}]}' -curl 'https://api.pdfrest.com/pdf-with-page-boxes-set' \ +curl "$API_URL/pdf-with-page-boxes-set" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"output\": \"example_out.pdf\", \"id\": \"$UPLOAD_ID\", \"boxes\": \"{\\\"boxes\\\":[{\\\"box\\\":\\\"media\\\",\\\"pages\\\":[{\\\"range\\\":\\\"1\\\",\\\"left\\\":100,\\\"top\\\":100,\\\"bottom\\\":100,\\\"right\\\":100}]}]}\" }" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.sh index dcef572b..2751b2b7 100644 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-applied.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -REDACTED_OUTPUT=$(curl 'https://api.pdfrest.com/pdf-with-redacted-text-applied' \ +REDACTED_OUTPUT=$(curl "$API_URL/pdf-with-redacted-text-applied" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}") echo $REDACTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. @@ -28,7 +35,7 @@ echo $REDACTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then PREVIEW_PDF_ID=$(jq -r '.inputId' <<< $REDACTED_OUTPUT) APPLIED_PDF_ID=$(jq -r '.outputId' <<< $REDACTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $PREVIEW_PDF_ID, $APPLIED_PDF_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.sh b/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.sh index 5df12f98..30dc819d 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf-with-redacted-text-preview.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -10,16 +17,16 @@ echo "File successfully uploaded with an ID of: $UPLOAD_ID" REDACTIONS='[{\"type\":\"preset\",\"value\":\"email\"},{\"type\":\"regex\",\"value\":\"(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]\\\\d{3}[\\\\s.-]\\\\d{4}\"},{\"type\":\"literal\",\"value\":\"word\"}]' -PREVIEW_OUTPUT=$(curl 'https://api.pdfrest.com/pdf-with-redacted-text-preview' \ +PREVIEW_OUTPUT=$(curl "$API_URL/pdf-with-redacted-text-preview" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"redactions\": \"$REDACTIONS\"}") echo $PREVIEW_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # IMPORTANT: Do not delete the PREVIEW_PDF_ID file until after the redaction is applied @@ -31,7 +38,7 @@ PREVIEW_PDF_ID=$(jq -r '.outputId' <<< $PREVIEW_OUTPUT) # Enable by uncommenting the next line to delete sensitive files # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $PREVIEW_PDF_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdf.sh b/cURL/Endpoint Examples/JSON Payload/pdf.sh index 3962af7d..283bef0a 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.png' \ --data-binary '@//path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdf' \ +curl "$API_URL/pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdfa.sh b/cURL/Endpoint Examples/JSON Payload/pdfa.sh index 2a57d2c9..60cd0486 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdfa.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdfa.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdfa' \ +curl "$API_URL/pdfa" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"output_type\": \"PDF/A-1b\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/pdfx.sh b/cURL/Endpoint Examples/JSON Payload/pdfx.sh index 431d0a37..58f663ac 100755 --- a/cURL/Endpoint Examples/JSON Payload/pdfx.sh +++ b/cURL/Endpoint Examples/JSON Payload/pdfx.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/pdfx' \ +curl "$API_URL/pdfx" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"output_type\": \"PDF/X-4\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/png.sh b/cURL/Endpoint Examples/JSON Payload/png.sh index f1fa60cd..57337e50 100755 --- a/cURL/Endpoint Examples/JSON Payload/png.sh +++ b/cURL/Endpoint Examples/JSON Payload/png.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/png' \ +curl "$API_URL/png" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/powerpoint.sh b/cURL/Endpoint Examples/JSON Payload/powerpoint.sh index 961bdf97..714390fa 100644 --- a/cURL/Endpoint Examples/JSON Payload/powerpoint.sh +++ b/cURL/Endpoint Examples/JSON Payload/powerpoint.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/powerpoint' \ +curl "$API_URL/powerpoint" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/rasterized-pdf.sh b/cURL/Endpoint Examples/JSON Payload/rasterized-pdf.sh index 6546d77e..568bfdef 100755 --- a/cURL/Endpoint Examples/JSON Payload/rasterized-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/rasterized-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/rasterized-pdf' \ +curl "$API_URL/rasterized-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-and-restrictions.sh b/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-and-restrictions.sh index f5720091..529f7523 100755 --- a/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-and-restrictions.sh +++ b/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-and-restrictions.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -RESTRICTED_OUTPUT=$(curl 'https://api.pdfrest.com/restricted-pdf' \ +RESTRICTED_OUTPUT=$(curl "$API_URL/restricted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"new_permissions_password\": \"restricted\", \"restrictions\": [\"print_low\", \"accessibility_off\"]}") echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then RESTRICTED_OUTPUT_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $RESTRICTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-with-open-password.sh b/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-with-open-password.sh index 5e717651..572baf42 100755 --- a/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-with-open-password.sh +++ b/cURL/Endpoint Examples/JSON Payload/restricted-pdf-add-password-with-open-password.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -RESTRICTED_OUTPUT=$(curl 'https://api.pdfrest.com/restricted-pdf' \ +RESTRICTED_OUTPUT=$(curl "$API_URL/restricted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_open_password\": \"encrypted\", \"new_permissions_password\": \"restricted\", \"restrictions\": [\"print_low\"]}") echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then RESTRICTED_OUTPUT_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $RESTRICTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/restricted-pdf-change-password.sh b/cURL/Endpoint Examples/JSON Payload/restricted-pdf-change-password.sh index 09fbdffd..cafa7b96 100755 --- a/cURL/Endpoint Examples/JSON Payload/restricted-pdf-change-password.sh +++ b/cURL/Endpoint Examples/JSON Payload/restricted-pdf-change-password.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -RESTRICTED_OUTPUT=$(curl 'https://api.pdfrest.com/restricted-pdf' \ +RESTRICTED_OUTPUT=$(curl "$API_URL/restricted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_permissions_password\": \"password\", \"new_permissions_password\": \"restricted\", \"restrictions\": [\"print_low\"]}") echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then RESTRICTED_OUTPUT_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $RESTRICTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/restricted-pdf.sh b/cURL/Endpoint Examples/JSON Payload/restricted-pdf.sh index f45ba379..e636e5e1 100755 --- a/cURL/Endpoint Examples/JSON Payload/restricted-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/restricted-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -RESTRICTED_OUTPUT=$(curl 'https://api.pdfrest.com/restricted-pdf' \ +RESTRICTED_OUTPUT=$(curl "$API_URL/restricted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\",\"new_permissions_password\": \"restricted\"}") echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -26,7 +33,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then RESTRICTED_OUTPUT_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_ID, $RESTRICTED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.sh b/cURL/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.sh index 18de09bd..a30dc839 100644 --- a/cURL/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.sh +++ b/cURL/Endpoint Examples/JSON Payload/signed-pdf-non-pfx.sh @@ -1,8 +1,15 @@ #!/bin/sh +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY=xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -PDF_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +PDF_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: input.pdf' \ --data-binary '@/path/to/input.pdf' \ @@ -10,7 +17,7 @@ PDF_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF successfully uploaded with an ID of: $PDF_ID" -CERT_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +CERT_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: certificate.pem' \ --data-binary '@/path/to/certificate.pem' \ @@ -18,7 +25,7 @@ CERT_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Certificate file successfully uploaded with an ID of: $CREDS_ID" -KEY_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +KEY_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: private_key.pem' \ --data-binary '@/path/to/private_key.pem' \ @@ -28,7 +35,7 @@ echo "Key file successfully uploaded with an ID of: $PASSPHRASE_ID" SIGNATURE_CONFIG='{\"type\": \"new\",\"name\": \"esignature\",\"location\": {\"bottom_left\": { \"x\": \"0\", \"y\": \"0\" },\"top_right\": { \"x\": \"216\", \"y\": \"72\" },\"page\": 1},\"display\": {\"include_datetime\": \"true\"}}' -curl 'https://api.pdfrest.com/signed-pdf' \ +curl "$API_URL/signed-pdf" \ --header "Api-Key: $API_KEY" \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$PDF_ID\", \"certificate_id\": \"$CERT_ID\", \"private_key_id\": \"$KEY_ID\", \"signature_configuration\": \"$SIGNATURE_CONFIG\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/signed-pdf.sh b/cURL/Endpoint Examples/JSON Payload/signed-pdf.sh index 8b48e9e3..49b0d57c 100755 --- a/cURL/Endpoint Examples/JSON Payload/signed-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/signed-pdf.sh @@ -1,8 +1,15 @@ #!/bin/sh +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY=xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -PDF_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +PDF_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: input.pdf' \ --data-binary '@/path/to/input.pdf' \ @@ -10,7 +17,7 @@ PDF_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF successfully uploaded with an ID of: $PDF_ID" -CREDS_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +CREDS_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: credentials.pfx' \ --data-binary '@/path/to/credentials.pfx' \ @@ -18,7 +25,7 @@ CREDS_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Credential file successfully uploaded with an ID of: $CREDS_ID" -PASSPHRASE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +PASSPHRASE_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: passphrase.txt' \ --data-binary '@/path/to/passphrase.txt' \ @@ -26,7 +33,7 @@ PASSPHRASE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Passphrase file successfully uploaded with an ID of: $PASSPHRASE_ID" -LOGO_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +LOGO_ID=$(curl --location "$API_URL/upload" \ --header "Api-Key: $API_KEY" \ --header 'content-filename: logo.png' \ --data-binary '@/path/to/logo.png' \ @@ -36,7 +43,7 @@ echo "Logo image successfully uploaded with an ID of: $LOGO_ID" SIGNATURE_CONFIG='{\"type\": \"new\",\"name\": \"esignature\",\"logo_opacity\": \"0.25\",\"location\": {\"bottom_left\": { \"x\": \"0\", \"y\": \"0\" },\"top_right\": { \"x\": \"216\", \"y\": \"72\" },\"page\": 1},\"display\": {\"include_distinguished_name\": \"true\",\"include_datetime\": \"true\",\"contact\": \"My contact info\",\"location\": \"My location\",\"name\": \"John Doe\",\"reason\": \"My reason for signing\"}}' -curl 'https://api.pdfrest.com/signed-pdf' \ +curl "$API_URL/signed-pdf" \ --header "Api-Key: $API_KEY" \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$PDF_ID\", \"pfx_credential_id\": \"$CREDS_ID\", \"pfx_passphrase_id\": \"$PASSPHRASE_ID\", \"logo_id\": \"$LOGO_ID\", \"signature_configuration\": \"$SIGNATURE_CONFIG\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/split-pdf-custom-ranges.sh b/cURL/Endpoint Examples/JSON Payload/split-pdf-custom-ranges.sh index b55eae40..58a3cb69 100755 --- a/cURL/Endpoint Examples/JSON Payload/split-pdf-custom-ranges.sh +++ b/cURL/Endpoint Examples/JSON Payload/split-pdf-custom-ranges.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/split-pdf' \ +curl "$API_URL/split-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"pages\": [1,2]}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/split-pdf-delete-page.sh b/cURL/Endpoint Examples/JSON Payload/split-pdf-delete-page.sh index 16922a7b..050b32b3 100755 --- a/cURL/Endpoint Examples/JSON Payload/split-pdf-delete-page.sh +++ b/cURL/Endpoint Examples/JSON Payload/split-pdf-delete-page.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/split-pdf' \ +curl "$API_URL/split-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"pages\": [\"1-3\",5,6]}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/split-pdf-odd-and-even.sh b/cURL/Endpoint Examples/JSON Payload/split-pdf-odd-and-even.sh index a60bd028..759f5e65 100755 --- a/cURL/Endpoint Examples/JSON Payload/split-pdf-odd-and-even.sh +++ b/cURL/Endpoint Examples/JSON Payload/split-pdf-odd-and-even.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/split-pdf' \ +curl "$API_URL/split-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\", \"pages\": [\"even\",\"odd\"]}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/split-pdf.sh b/cURL/Endpoint Examples/JSON Payload/split-pdf.sh index 69d4604a..7628b6ca 100755 --- a/cURL/Endpoint Examples/JSON Payload/split-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/split-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/split-pdf' \ +curl "$API_URL/split-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/tif.sh b/cURL/Endpoint Examples/JSON Payload/tif.sh index 14c660c3..2b7d9116 100755 --- a/cURL/Endpoint Examples/JSON Payload/tif.sh +++ b/cURL/Endpoint Examples/JSON Payload/tif.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/tif' \ +curl "$API_URL/tif" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf-with-open-password.sh b/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf-with-open-password.sh index c0af7d40..0ccf95fb 100755 --- a/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf-with-open-password.sh +++ b/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf-with-open-password.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -UNRESTRICTED_OUTPUT=$(curl 'https://api.pdfrest.com/unrestricted-pdf' \ +UNRESTRICTED_OUTPUT=$(curl "$API_URL/unrestricted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\",\"current_open_password\": \"restricted\", \"current_permissions_password\":\"restricted\"}") echo $UNRESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -27,7 +34,7 @@ echo $UNRESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then UNRESTRICTED_ID=$(jq -r '.outputId' <<< $UNRESTRICTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $UNRESTRICTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$INPUT_PDF_ID, $UNRESTRICTED_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf.sh b/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf.sh index 30c01207..fdcdaf5e 100755 --- a/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/unrestricted-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,16 +15,16 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -UNRESTRICTED_OUTPUT=$(curl 'https://api.pdfrest.com/unrestricted-pdf' \ +UNRESTRICTED_OUTPUT=$(curl "$API_URL/unrestricted-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\",\"current_permissions_password\":\"restricted\"}") echo $UNRESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -27,7 +34,7 @@ echo $UNRESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then UNRESTRICTED_ID=$(jq -r '.outputId' <<< $UNRESTRICTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $UNRESTRICTED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$INPUT_PDF_ID, $UNRESTRICTED_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/unzip.sh b/cURL/Endpoint Examples/JSON Payload/unzip.sh index 8d5de4a3..18690d10 100755 --- a/cURL/Endpoint Examples/JSON Payload/unzip.sh +++ b/cURL/Endpoint Examples/JSON Payload/unzip.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.zip' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/unzip' \ +curl "$API_URL/unzip" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/up-toolkit.sh b/cURL/Endpoint Examples/JSON Payload/up-toolkit.sh index e66dd9e0..1b00a3d1 100755 --- a/cURL/Endpoint Examples/JSON Payload/up-toolkit.sh +++ b/cURL/Endpoint Examples/JSON Payload/up-toolkit.sh @@ -1,2 +1,9 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + #up-forms and up-office can be used to query the other tools -curl -X GET "https://api.pdfrest.com/up-toolkit" +curl -X GET "$API_URL/up-toolkit" diff --git a/cURL/Endpoint Examples/JSON Payload/upload.sh b/cURL/Endpoint Examples/JSON Payload/upload.sh index 4fe51310..9449307a 100755 --- a/cURL/Endpoint Examples/JSON Payload/upload.sh +++ b/cURL/Endpoint Examples/JSON Payload/upload.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'api-key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ diff --git a/cURL/Endpoint Examples/JSON Payload/watermarked-pdf-image.sh b/cURL/Endpoint Examples/JSON Payload/watermarked-pdf-image.sh index f94a9980..d386c109 100755 --- a/cURL/Endpoint Examples/JSON Payload/watermarked-pdf-image.sh +++ b/cURL/Endpoint Examples/JSON Payload/watermarked-pdf-image.sh @@ -1,5 +1,13 @@ #!/bin/sh -UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ + +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_PDF_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: pdf_filename.pdf' \ --data-binary '@/path/to/pdf_file' \ @@ -7,7 +15,7 @@ UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" -UPLOAD_WATERMARK_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +UPLOAD_WATERMARK_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: watermark_filename.pdf' \ --data-binary '@/path/to/watermark_file' \ @@ -15,16 +23,16 @@ UPLOAD_WATERMARK_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Watermark file successfully uploaded with an ID of: $UPLOAD_WATERMARK_FILE_ID" -WATERMARKED_OUTPUT=$(curl 'https://api.pdfrest.com/watermarked-pdf' \ +WATERMARKED_OUTPUT=$(curl "$API_URL/watermarked-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_PDF_FILE_ID\", \"watermark_file_id\": \"$UPLOAD_WATERMARK_FILE_ID\" }") echo $WATERMARKED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -33,7 +41,7 @@ echo $WATERMARKED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then WATERMARKED_OUTPUT_ID=$(jq -r '.outputId' <<< $WATERMARKED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_PDF_FILE_ID, $UPLOAD_WATERMARK_FILE_ID, $WATERMARKED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/watermarked-pdf.sh b/cURL/Endpoint Examples/JSON Payload/watermarked-pdf.sh index 68460e63..dc3a6e41 100755 --- a/cURL/Endpoint Examples/JSON Payload/watermarked-pdf.sh +++ b/cURL/Endpoint Examples/JSON Payload/watermarked-pdf.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_PDF_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -9,16 +16,16 @@ UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" -WATERMARKED_OUTPUT=$(curl 'https://api.pdfrest.com/watermarked-pdf' \ +WATERMARKED_OUTPUT=$(curl "$API_URL/watermarked-pdf" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_PDF_FILE_ID\", \"watermark_text\": \"watermark\" }") echo $WATERMARKED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -27,7 +34,7 @@ echo $WATERMARKED_OUTPUT | jq -r '.' # DELETE_SENSITIVE_FILES=true if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then WATERMARKED_OUTPUT_ID=$(jq -r '.outputId' <<< $WATERMARKED_OUTPUT) -curl --request POST "https://api.pdfrest.com/delete" \ +curl --request POST "$API_URL/delete" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"ids\": \"$UPLOAD_PDF_FILE_ID, $WATERMARKED_OUTPUT_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/word.sh b/cURL/Endpoint Examples/JSON Payload/word.sh index da5fbf29..9360cebc 100644 --- a/cURL/Endpoint Examples/JSON Payload/word.sh +++ b/cURL/Endpoint Examples/JSON Payload/word.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: filename.pdf' \ --data-binary '@/path/to/file' \ @@ -8,7 +15,7 @@ UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "File successfully uploaded with an ID of: $UPLOAD_ID" -curl 'https://api.pdfrest.com/word' \ +curl "$API_URL/word" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' diff --git a/cURL/Endpoint Examples/JSON Payload/zip.sh b/cURL/Endpoint Examples/JSON Payload/zip.sh index 4353c638..ab138747 100755 --- a/cURL/Endpoint Examples/JSON Payload/zip.sh +++ b/cURL/Endpoint Examples/JSON Payload/zip.sh @@ -1,6 +1,13 @@ #!/bin/sh -UPLOAD_FIRST_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UPLOAD_FIRST_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: first_filename.pdf' \ --data-binary '@/path/to/first_file' \ @@ -8,7 +15,7 @@ UPLOAD_FIRST_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "First file successfully uploaded with an ID of: $UPLOAD_FIRST_FILE_ID" - UPLOAD_SECOND_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ + UPLOAD_SECOND_FILE_ID=$(curl --location "$API_URL/upload" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'content-filename: second_filename.pdf' \ --data-binary '@//path/to/second_file' \ @@ -16,7 +23,7 @@ UPLOAD_FIRST_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ echo "Second file successfully uploaded with an ID of: $UPLOAD_SECOND_FILE_ID" -curl 'https://api.pdfrest.com/zip' \ +curl "$API_URL/zip" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ --header 'Content-Type: application/json' \ --data-raw "{ \"id\": [\"$UPLOAD_FIRST_FILE_ID\", \"$UPLOAD_SECOND_FILE_ID\"]}" | jq -r '.' diff --git a/cURL/Endpoint Examples/Multipart Payload/batch-delete.sh b/cURL/Endpoint Examples/Multipart Payload/batch-delete.sh index 66f22e3f..d5f8a605 100755 --- a/cURL/Endpoint Examples/Multipart Payload/batch-delete.sh +++ b/cURL/Endpoint Examples/Multipart Payload/batch-delete.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/delete" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/bmp.sh b/cURL/Endpoint Examples/Multipart Payload/bmp.sh index 7a5800a3..83f41d6c 100755 --- a/cURL/Endpoint Examples/Multipart Payload/bmp.sh +++ b/cURL/Endpoint Examples/Multipart Payload/bmp.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/bmp" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/bmp" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/compressed-pdf-custom.sh b/cURL/Endpoint Examples/Multipart Payload/compressed-pdf-custom.sh index 49aa5f11..d02261e4 100755 --- a/cURL/Endpoint Examples/Multipart Payload/compressed-pdf-custom.sh +++ b/cURL/Endpoint Examples/Multipart Payload/compressed-pdf-custom.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/compressed-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/compressed-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/compressed-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/compressed-pdf.sh index 13fb428b..2ff06c70 100755 --- a/cURL/Endpoint Examples/Multipart Payload/compressed-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/compressed-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/compressed-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/compressed-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf-with-permissions-password.sh b/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf-with-permissions-password.sh index 448528d1..22c6e37a 100755 --- a/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf-with-permissions-password.sh +++ b/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf-with-permissions-password.sh @@ -1,4 +1,11 @@ -DECRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/decrypted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +DECRYPTED_OUTPUT=$(curl -X POST "$API_URL/decrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -9,9 +16,9 @@ DECRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/decrypted-pdf" \ echo $DECRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -21,7 +28,7 @@ echo $DECRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then DECRYPTED_ID=$(jq -r '.outputId' <<< $DECRYPTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $DECRYPTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf.sh index d1f753aa..2620e520 100755 --- a/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/decrypted-pdf.sh @@ -1,4 +1,11 @@ -DECRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/decrypted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +DECRYPTED_OUTPUT=$(curl -X POST "$API_URL/decrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -8,9 +15,9 @@ DECRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/decrypted-pdf" \ echo $DECRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -20,7 +27,7 @@ echo $DECRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then DECRYPTED_ID=$(jq -r '.outputId' <<< $DECRYPTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $DECRYPTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/delete-resource.sh b/cURL/Endpoint Examples/Multipart Payload/delete-resource.sh index 99b83f9c..83975ddb 100644 --- a/cURL/Endpoint Examples/Multipart Payload/delete-resource.sh +++ b/cURL/Endpoint Examples/Multipart Payload/delete-resource.sh @@ -1,3 +1,11 @@ #!/bin/sh -curl --request DELETE "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ + +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl --request DELETE "$API_URL/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ --header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ diff --git a/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-change-password.sh b/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-change-password.sh index c9d8c60e..6c212a09 100755 --- a/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-change-password.sh +++ b/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-change-password.sh @@ -1,4 +1,11 @@ -ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +ENCRYPTED_OUTPUT=$(curl -X POST "$API_URL/encrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -9,9 +16,9 @@ ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -21,7 +28,7 @@ echo $ENCRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $ENCRYPTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-new-password-with-permissions-password.sh b/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-new-password-with-permissions-password.sh index 0cf2cd89..dad05217 100755 --- a/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-new-password-with-permissions-password.sh +++ b/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf-new-password-with-permissions-password.sh @@ -1,4 +1,11 @@ -ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +ENCRYPTED_OUTPUT=$(curl -X POST "$API_URL/encrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -9,9 +16,9 @@ ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -21,7 +28,7 @@ echo $ENCRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $ENCRYPTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf.sh index 3f728b6d..2bd12fab 100755 --- a/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/encrypted-pdf.sh @@ -1,4 +1,12 @@ -ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + + +ENCRYPTED_OUTPUT=$(curl -X POST "$API_URL/encrypted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -8,9 +16,9 @@ ENCRYPTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/encrypted-pdf" \ echo $ENCRYPTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -20,7 +28,7 @@ echo $ENCRYPTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $ENCRYPTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $ENCRYPTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/excel.sh b/cURL/Endpoint Examples/Multipart Payload/excel.sh index ee4dcbf8..4ebdeff6 100644 --- a/cURL/Endpoint Examples/Multipart Payload/excel.sh +++ b/cURL/Endpoint Examples/Multipart Payload/excel.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/excel" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/excel" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/exported-form-data.sh b/cURL/Endpoint Examples/Multipart Payload/exported-form-data.sh index cf594dda..8e99a941 100755 --- a/cURL/Endpoint Examples/Multipart Payload/exported-form-data.sh +++ b/cURL/Endpoint Examples/Multipart Payload/exported-form-data.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/exported-form-data" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/exported-form-data" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/extracted-images.sh b/cURL/Endpoint Examples/Multipart Payload/extracted-images.sh index 771f7c5d..ce5ec79f 100755 --- a/cURL/Endpoint Examples/Multipart Payload/extracted-images.sh +++ b/cURL/Endpoint Examples/Multipart Payload/extracted-images.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/extracted-images" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/extracted-images" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/extracted-text.sh b/cURL/Endpoint Examples/Multipart Payload/extracted-text.sh index a7d54dd2..692c792c 100755 --- a/cURL/Endpoint Examples/Multipart Payload/extracted-text.sh +++ b/cURL/Endpoint Examples/Multipart Payload/extracted-text.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/extracted-text" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/extracted-text" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.sh index 612e6a27..2ac097a1 100755 --- a/cURL/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/flattened-annotations-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/flattened-annotations-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/flattened-forms-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/flattened-forms-pdf.sh index d65adeac..2d49887a 100644 --- a/cURL/Endpoint Examples/Multipart Payload/flattened-forms-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/flattened-forms-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/flattened-forms-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/flattened-forms-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/flattened-layers-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/flattened-layers-pdf.sh index d854e2d0..19c999d8 100755 --- a/cURL/Endpoint Examples/Multipart Payload/flattened-layers-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/flattened-layers-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/flattened-layers-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/flattened-layers-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf-medium.sh b/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf-medium.sh index 1ca2b845..7a3bf209 100755 --- a/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf-medium.sh +++ b/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf-medium.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/flattened-transparencies-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/flattened-transparencies-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.sh index e63a949e..6dd2aea0 100755 --- a/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/flattened-transparencies-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/flattened-transparencies-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/get-resource.sh b/cURL/Endpoint Examples/Multipart Payload/get-resource.sh index fddd19dc..4a4169c1 100755 --- a/cURL/Endpoint Examples/Multipart Payload/get-resource.sh +++ b/cURL/Endpoint Examples/Multipart Payload/get-resource.sh @@ -1 +1,8 @@ -curl -X GET "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url" +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X GET "$API_URL/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url" diff --git a/cURL/Endpoint Examples/Multipart Payload/gif.sh b/cURL/Endpoint Examples/Multipart Payload/gif.sh index 8df51d38..037540f9 100755 --- a/cURL/Endpoint Examples/Multipart Payload/gif.sh +++ b/cURL/Endpoint Examples/Multipart Payload/gif.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/gif" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/gif" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/jpg.sh b/cURL/Endpoint Examples/Multipart Payload/jpg.sh index 5de4d0af..11e9ff59 100755 --- a/cURL/Endpoint Examples/Multipart Payload/jpg.sh +++ b/cURL/Endpoint Examples/Multipart Payload/jpg.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/jpg" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/jpg" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/linearized-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/linearized-pdf.sh index 8eaca0ae..b8ef1d35 100755 --- a/cURL/Endpoint Examples/Multipart Payload/linearized-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/linearized-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/linearized-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/linearized-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/markdown.sh b/cURL/Endpoint Examples/Multipart Payload/markdown.sh index b99b7ed0..c488b426 100644 --- a/cURL/Endpoint Examples/Multipart Payload/markdown.sh +++ b/cURL/Endpoint Examples/Multipart Payload/markdown.sh @@ -1,6 +1,13 @@ #!/bin/sh -curl -X POST "https://api.pdfrest.com/markdown" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/markdown" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/merged-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/merged-pdf.sh index f00c39f0..8b635be3 100755 --- a/cURL/Endpoint Examples/Multipart Payload/merged-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/merged-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/merged-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/merged-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-html-to-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-html-to-pdf.sh index 22ee8298..242f1df7 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-html-to-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-html-to-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-info.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-info.sh index e6137cf9..ff52e99c 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-info.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-info.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf-info" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-info" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-acroforms.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-acroforms.sh index 46df23f2..2e9b4a49 100644 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-acroforms.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-acroforms.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf-with-acroforms" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-with-acroforms" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.sh index b725b934..e6009953 100644 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-attachment.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf-with-added-attachment" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-with-added-attachment" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-image.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-image.sh index accd4c21..10e68127 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-image.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-image.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf-with-added-image" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-with-added-image" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-text.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-text.sh index e846bf48..1859e0ab 100644 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-text.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-added-text.sh @@ -1,6 +1,13 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + TEXT_OPTIONS='[{"font":"Times New Roman","max_width":"175","opacity":"1","page":"1","rotation":"0","text":"sample text in PDF","text_color_rgb":"0,0,0","text_size":"30","x":"72","y":"144"}]' -curl -X POST "https://api.pdfrest.com/pdf-with-added-text" \ +curl -X POST "$API_URL/pdf-with-added-text" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.sh index de6f2ddf..52e1d3b7 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-converted-colors.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf-with-converted-colors" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-with-converted-colors" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.sh index 245b385d..053cdbe6 100644 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.sh @@ -1,7 +1,14 @@ -curl -X POST "https://api.pdfrest.com/pdf-with-imported-form-data" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-with-imported-form-data" \ -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 "data_file=@/path/to/datafile" \ No newline at end of file + -F "data_file=@/path/to/datafile" diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.sh index 1f470d30..f36b70f9 100644 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-ocr-text.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf-with-ocr-text" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf-with-ocr-text" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.sh index b85fe7b0..dbe56dc7 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-page-boxes-set.sh @@ -1,6 +1,13 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + BOXES='{"boxes":[{"box":"media","pages":[{"range":"1","left":100,"top":100,"bottom":100,"right":100}]}]}' -curl -X POST "https://api.pdfrest.com/pdf-with-page-boxes-set" \ +curl -X POST "$API_URL/pdf-with-page-boxes-set" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.sh index 7ae5eb4c..6159aec3 100644 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-applied.sh @@ -1,4 +1,11 @@ -REDACTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-applied" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +REDACTED_OUTPUT=$(curl -X POST "$API_URL/pdf-with-redacted-text-applied" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -7,9 +14,9 @@ REDACTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-a echo $REDACTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -19,7 +26,7 @@ echo $REDACTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then PREVIEW_PDF_ID=$(jq -r '.inputId' <<< $REDACTED_OUTPUT) APPLIED_PDF_ID=$(jq -r '.outputId' <<< $REDACTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.sh b/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.sh index a3a076bd..a36bf9be 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf-with-redacted-text-preview.sh @@ -1,6 +1,13 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + REDACTIONS='[{"type":"preset","value":"email"},{"type":"regex","value":"(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]\\d{3}[\\s.-]\\d{4}"},{"type":"literal","value":"word"}]' -PREVIEW_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-preview" \ +PREVIEW_OUTPUT=$(curl -X POST "$API_URL/pdf-with-redacted-text-preview" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -10,9 +17,9 @@ PREVIEW_OUTPUT=$(curl -X POST "https://api.pdfrest.com/pdf-with-redacted-text-pr echo $PREVIEW_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # IMPORTANT: Do not delete the PREVIEW_PDF_ID file until after the redaction is applied @@ -26,7 +33,7 @@ echo $PREVIEW_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $PREVIEW_OUTPUT) PREVIEW_PDF_ID=$(jq -r '.outputId' <<< $PREVIEW_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdf.sh b/cURL/Endpoint Examples/Multipart Payload/pdf.sh index 02d11aaf..05ea220c 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdfa.sh b/cURL/Endpoint Examples/Multipart Payload/pdfa.sh index 7b48bb70..a208338d 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdfa.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdfa.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdfa" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdfa" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/pdfx.sh b/cURL/Endpoint Examples/Multipart Payload/pdfx.sh index ce45c0ff..532ca8f3 100755 --- a/cURL/Endpoint Examples/Multipart Payload/pdfx.sh +++ b/cURL/Endpoint Examples/Multipart Payload/pdfx.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/pdfx" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/pdfx" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/png.sh b/cURL/Endpoint Examples/Multipart Payload/png.sh index 2f02d724..f23ed74e 100755 --- a/cURL/Endpoint Examples/Multipart Payload/png.sh +++ b/cURL/Endpoint Examples/Multipart Payload/png.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/png" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/png" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/powerpoint.sh b/cURL/Endpoint Examples/Multipart Payload/powerpoint.sh index 49c86731..84edc970 100644 --- a/cURL/Endpoint Examples/Multipart Payload/powerpoint.sh +++ b/cURL/Endpoint Examples/Multipart Payload/powerpoint.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/powerpoint" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/powerpoint" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/rasterized-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/rasterized-pdf.sh index a95f3336..bc6f5fb2 100755 --- a/cURL/Endpoint Examples/Multipart Payload/rasterized-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/rasterized-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/rasterized-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/rasterized-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/request-status.sh b/cURL/Endpoint Examples/Multipart Payload/request-status.sh index f6a648c4..18e53886 100755 --- a/cURL/Endpoint Examples/Multipart Payload/request-status.sh +++ b/cURL/Endpoint Examples/Multipart Payload/request-status.sh @@ -1,10 +1,17 @@ #!/bin/sh +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + API_KEY="xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # Send a request with the response-type header. -REQUEST_ID=$(curl -X POST "https://api.pdfrest.com/pdfa" \ +REQUEST_ID=$(curl -X POST "$API_URL/pdfa" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: $API_KEY" \ @@ -16,7 +23,7 @@ REQUEST_ID=$(curl -X POST "https://api.pdfrest.com/pdfa" \ # Get the request status at /request-status -RESPONSE=$(curl -X GET "https://api.pdfrest.com/request-status/$REQUEST_ID" \ +RESPONSE=$(curl -X GET "$API_URL/request-status/$REQUEST_ID" \ -H "Api-Key: $API_KEY") echo $RESPONSE STATUS=$(echo $RESPONSE | jq -r '.status') @@ -26,8 +33,8 @@ STATUS=$(echo $RESPONSE | jq -r '.status') while [ $STATUS = "pending" ] do sleep 5 - RESPONSE=$(curl -X GET "https://api.pdfrest.com/request-status/$REQUEST_ID" \ + RESPONSE=$(curl -X GET "$API_URL/request-status/$REQUEST_ID" \ -H "Api-Key: $API_KEY") echo $RESPONSE STATUS=$(echo $RESPONSE | jq -r '.status') -done \ No newline at end of file +done diff --git a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-and-restrictions.sh b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-and-restrictions.sh index 4b65afc9..0704edd1 100755 --- a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-and-restrictions.sh +++ b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-and-restrictions.sh @@ -1,4 +1,11 @@ -RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +RESTRICTED_OUTPUT=$(curl -X POST "$API_URL/restricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -10,9 +17,9 @@ RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -22,7 +29,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $RESTRICTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-with-open-password.sh b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-with-open-password.sh index cbb230ed..691c0209 100755 --- a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-with-open-password.sh +++ b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-add-password-with-open-password.sh @@ -1,4 +1,11 @@ -RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +RESTRICTED_OUTPUT=$(curl -X POST "$API_URL/restricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -10,9 +17,9 @@ RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -22,7 +29,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $RESTRICTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-change-password.sh b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-change-password.sh index 3b2c0a49..a4d99939 100755 --- a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-change-password.sh +++ b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf-change-password.sh @@ -1,4 +1,11 @@ -RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +RESTRICTED_OUTPUT=$(curl -X POST "$API_URL/restricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -10,9 +17,9 @@ RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -22,7 +29,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $RESTRICTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf.sh index b192d1a2..7b53546e 100755 --- a/cURL/Endpoint Examples/Multipart Payload/restricted-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/restricted-pdf.sh @@ -1,4 +1,11 @@ -RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +RESTRICTED_OUTPUT=$(curl -X POST "$API_URL/restricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -8,9 +15,9 @@ RESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/restricted-pdf" \ echo $RESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -20,7 +27,7 @@ echo $RESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId' <<< $RESTRICTED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $RESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.sh b/cURL/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.sh index 1e19dd24..edb82b74 100644 --- a/cURL/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.sh +++ b/cURL/Endpoint Examples/Multipart Payload/signed-pdf-non-pfx.sh @@ -1,6 +1,13 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + SIGNATURE_CONFIG='{"type": "new","name": "esignature","location": {"bottom_left": { "x": "0", "y": "0" },"top_right": { "x": "216", "y": "72" },"page": 1},"display": {"include_datetime": "true"}}' -curl -X POST "https://api.pdfrest.com/signed-pdf" \ +curl -X POST "$API_URL/signed-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/signed-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/signed-pdf.sh index 7bced55c..defb5ce1 100644 --- a/cURL/Endpoint Examples/Multipart Payload/signed-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/signed-pdf.sh @@ -1,6 +1,13 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + SIGNATURE_CONFIG='{"type": "new","name": "esignature","logo_opacity": "0.25","location": {"bottom_left": { "x": "0", "y": "0" },"top_right": { "x": "216", "y": "72" },"page": 1},"display": {"include_distinguished_name": "true","include_datetime": "true","contact": "My contact info","location": "My location","name": "John Doe","reason": "My reason for signing"}}' -curl -X POST "https://api.pdfrest.com/signed-pdf" \ +curl -X POST "$API_URL/signed-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/split-pdf-custom-ranges.sh b/cURL/Endpoint Examples/Multipart Payload/split-pdf-custom-ranges.sh index 02907d0f..884c7653 100755 --- a/cURL/Endpoint Examples/Multipart Payload/split-pdf-custom-ranges.sh +++ b/cURL/Endpoint Examples/Multipart Payload/split-pdf-custom-ranges.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/split-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/split-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/split-pdf-delete-page.sh b/cURL/Endpoint Examples/Multipart Payload/split-pdf-delete-page.sh index 4c9a1d8f..11fc3f28 100755 --- a/cURL/Endpoint Examples/Multipart Payload/split-pdf-delete-page.sh +++ b/cURL/Endpoint Examples/Multipart Payload/split-pdf-delete-page.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/split-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/split-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/split-pdf-odd-and-even.sh b/cURL/Endpoint Examples/Multipart Payload/split-pdf-odd-and-even.sh index e141d7b8..a63c40d9 100755 --- a/cURL/Endpoint Examples/Multipart Payload/split-pdf-odd-and-even.sh +++ b/cURL/Endpoint Examples/Multipart Payload/split-pdf-odd-and-even.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/split-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/split-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/split-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/split-pdf.sh index 16f45618..2d24f969 100755 --- a/cURL/Endpoint Examples/Multipart Payload/split-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/split-pdf.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/split-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/split-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/tif.sh b/cURL/Endpoint Examples/Multipart Payload/tif.sh index cd172657..f4bf2937 100755 --- a/cURL/Endpoint Examples/Multipart Payload/tif.sh +++ b/cURL/Endpoint Examples/Multipart Payload/tif.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/tif" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/tif" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf-with-open-password.sh b/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf-with-open-password.sh index b0d28570..ce3456d8 100755 --- a/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf-with-open-password.sh +++ b/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf-with-open-password.sh @@ -1,4 +1,11 @@ -UNRESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/unrestricted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UNRESTRICTED_OUTPUT=$(curl -X POST "$API_URL/unrestricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -9,9 +16,9 @@ UNRESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/unrestricted-pdf" \ echo $UNRESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -21,7 +28,7 @@ echo $UNRESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then UNRESTRICTED_ID=$(jq -r '.outputId' <<< $UNRESTRICTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $UNRESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf.sh index 2b471e51..5b3e5c45 100755 --- a/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/unrestricted-pdf.sh @@ -1,4 +1,11 @@ -UNRESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/unrestricted-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +UNRESTRICTED_OUTPUT=$(curl -X POST "$API_URL/unrestricted-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -8,9 +15,9 @@ UNRESTRICTED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/unrestricted-pdf" \ echo $UNRESTRICTED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -20,7 +27,7 @@ echo $UNRESTRICTED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then UNRESTRICTED_ID=$(jq -r '.outputId' <<< $UNRESTRICTED_OUTPUT) INPUT_PDF_ID=$(jq -r '.inputId' <<< $UNRESTRICTED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/unzip.sh b/cURL/Endpoint Examples/Multipart Payload/unzip.sh index d0bfb3ee..f7e75bdf 100755 --- a/cURL/Endpoint Examples/Multipart Payload/unzip.sh +++ b/cURL/Endpoint Examples/Multipart Payload/unzip.sh @@ -1,5 +1,12 @@ -curl -X POST "https://api.pdfrest.com/unzip" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/unzip" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ - -F "file=@/path/to/file" + -F "file=@/path/to/file" diff --git a/cURL/Endpoint Examples/Multipart Payload/up-toolkit.sh b/cURL/Endpoint Examples/Multipart Payload/up-toolkit.sh index e66dd9e0..1b00a3d1 100755 --- a/cURL/Endpoint Examples/Multipart Payload/up-toolkit.sh +++ b/cURL/Endpoint Examples/Multipart Payload/up-toolkit.sh @@ -1,2 +1,9 @@ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + #up-forms and up-office can be used to query the other tools -curl -X GET "https://api.pdfrest.com/up-toolkit" +curl -X GET "$API_URL/up-toolkit" diff --git a/cURL/Endpoint Examples/Multipart Payload/upload.sh b/cURL/Endpoint Examples/Multipart Payload/upload.sh index 14d96ecf..bcbf8234 100755 --- a/cURL/Endpoint Examples/Multipart Payload/upload.sh +++ b/cURL/Endpoint Examples/Multipart Payload/upload.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/upload" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/upload" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf-image.sh b/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf-image.sh index c8754d18..088fe61e 100755 --- a/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf-image.sh +++ b/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf-image.sh @@ -1,4 +1,11 @@ -WATERMARKED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/watermarked-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +WATERMARKED_OUTPUT=$(curl -X POST "$API_URL/watermarked-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -8,9 +15,9 @@ WATERMARKED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/watermarked-pdf" \ echo $WATERMARKED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -20,7 +27,7 @@ echo $WATERMARKED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_IDS=$(jq -r '.inputId | join(",")' <<< $WATERMARKED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $WATERMARKED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf.sh b/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf.sh index 80dde68e..e4279127 100755 --- a/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf.sh +++ b/cURL/Endpoint Examples/Multipart Payload/watermarked-pdf.sh @@ -1,4 +1,11 @@ -WATERMARKED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/watermarked-pdf" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +WATERMARKED_OUTPUT=$(curl -X POST "$API_URL/watermarked-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ @@ -8,9 +15,9 @@ WATERMARKED_OUTPUT=$(curl -X POST "https://api.pdfrest.com/watermarked-pdf" \ echo $WATERMARKED_OUTPUT | jq -r '.' -# All files uploaded or generated are automatically deleted based on the -# File Retention Period as shown on https://pdfrest.com/pricing. -# For immediate deletion of files, particularly when sensitive data +# All files uploaded or generated are automatically deleted based on the +# File Retention Period as shown on https://pdfrest.com/pricing. +# For immediate deletion of files, particularly when sensitive data # is involved, an explicit delete call can be made to the API. # Optional deletion step — OFF by default. @@ -20,7 +27,7 @@ echo $WATERMARKED_OUTPUT | jq -r '.' if [ "$DELETE_SENSITIVE_FILES" = "true" ]; then INPUT_PDF_ID=$(jq -r '.inputId[0]' <<< $WATERMARKED_OUTPUT) OUTPUT_PDF_ID=$(jq -r '.outputId' <<< $WATERMARKED_OUTPUT) - curl -X POST "https://api.pdfrest.com/delete" \ + curl -X POST "$API_URL/delete" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/word.sh b/cURL/Endpoint Examples/Multipart Payload/word.sh index ce39735a..8a2d1b31 100644 --- a/cURL/Endpoint Examples/Multipart Payload/word.sh +++ b/cURL/Endpoint Examples/Multipart Payload/word.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/word" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/word" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ diff --git a/cURL/Endpoint Examples/Multipart Payload/zip.sh b/cURL/Endpoint Examples/Multipart Payload/zip.sh index bb87220b..9a98def2 100755 --- a/cURL/Endpoint Examples/Multipart Payload/zip.sh +++ b/cURL/Endpoint Examples/Multipart Payload/zip.sh @@ -1,4 +1,11 @@ -curl -X POST "https://api.pdfrest.com/zip" \ +# By default, we use the US-based API service. This is the primary endpoint for global use. +API_URL="https://api.pdfrest.com" + +# For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below. +# For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work +# API_URL="https://eu-api.pdfrest.com" + +curl -X POST "$API_URL/zip" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \