-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cURL samples for single-part calls
- Loading branch information
1 parent
62f4128
commit 47de4d9
Showing
43 changed files
with
607 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This directory contains examples of how to call each endpoint of the | ||
PdfRest API using cURL. Please refer to https://pdfrest.com/documentation.html | ||
for accepted inputs, options, and other specifics about individual endpoints. | ||
|
||
Note that these samples use the jq processor (https://jqlang.github.io/jq/) in | ||
order to parse the IDs of uploaded files and pretty-print the final output | ||
JSON. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/bmp' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/decrypted-pdf-with-permissions-password.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/decrypted-pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\", \"current_open_password\": \"encrypted\"}" | jq -r '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/encrypted-pdf-change-password.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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\"}" | jq -r '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/encrypted-pdf-new-password-with-permissions-password.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/extracted-text' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/flattened-annotations-pdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/flattened-annotations-pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/flattened-forms-pdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/flattened-forms-pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/flattened-layers-pdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/flattened-layers-pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf-medium.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
14 changes: 14 additions & 0 deletions
14
cURL/Endpoint Examples/JSON Payload/flattened-transparencies-pdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/flattened-transparencies-pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
curl -X GET "https://api.pdfrest.com/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?format=url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/gif' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/jpg' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/linearized-pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_FIRST_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: first_filename.pdf' \ | ||
--data-binary '@/path/to/first_file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "First file successfully uploaded with an ID of: $UPLOAD_FIRST_FILE_ID" | ||
|
||
UPLOAD_SECOND_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: second_filename.pdf' \ | ||
--data-binary '@/path/to/second_file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "Second file successfully uploaded with an ID of: $UPLOAD_SECOND_FILE_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
curl 'https://api.pdfrest.com/pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{ "url": "https://pdfrest.com/"}' | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
22 changes: 22 additions & 0 deletions
22
cURL/Endpoint Examples/JSON Payload/pdf-with-added-image.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/pdf_file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" | ||
|
||
UPLOAD_IMAGE_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.png' \ | ||
--data-binary '@/path/to/image_file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "Image file successfully uploaded with an ID of: $UPLOAD_IMAGE_FILE_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
22 changes: 22 additions & 0 deletions
22
cURL/Endpoint Examples/JSON Payload/pdf-with-imported-form-data.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_PDF_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/pdf_file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "PDF file successfully uploaded with an ID of: $UPLOAD_PDF_FILE_ID" | ||
|
||
UPLOAD_DATA_FILE_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.xml' \ | ||
--data-binary '@/path/to/data_file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "Data file successfully uploaded with an ID of: $UPLOAD_DATA_FILE_ID" | ||
|
||
curl 'https://api.pdfrest.com/pdf-with-added-image' \ | ||
--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 '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.png' \ | ||
--data-binary '@//path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/pdf' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "{ \"id\": \"$UPLOAD_ID\"}" | jq -r '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
UPLOAD_ID=$(curl --location 'https://api.pdfrest.com/upload' \ | ||
--header 'Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \ | ||
--header 'content-filename: filename.pdf' \ | ||
--data-binary '@/path/to/file' \ | ||
| jq -r '.files.[0].id') | ||
|
||
echo "File successfully uploaded with an ID of: $UPLOAD_ID" | ||
|
||
curl 'https://api.pdfrest.com/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 '.' |
Oops, something went wrong.