Documents
Learn how to generate or fetch your PDF documents with the PDFMonkey API
TL;DR
Sample HTTP request to generate a Document
curl \
"https://api.pdfmonkey.io/api/v1/documents" \
-X POST \
-H 'Authorization: Bearer YOUR-API-KEY' \
-H 'Content-Type: application/json' \
-d '{
"document": {
"document_template_id": "ID-OF-YOUR-TEMPLATE",
"status": "pending", // To force generation to be queued upon creation
"payload": {
"clientName": "Peter Parker",
"orderDate": "2050-03-14",
"products": [
{ "name": "Spider silk", "quantity": 12, "unitPrice": 123.50 },
{ "name": "Spandex fabric", "quantity": 2, "unitPrice": 28.90 }
]
},
"meta": {
"_filename": "2050-03-14 Peter Parker.pdf",
"clientRef": "spidey-616"
}
}
}'Response
Sample HTTP request to fetch details about a document
Response
Two Objects To Know
Rules of thumb
The Document object
Attributes
id
app_id
checksum
created_at
document_template_id
download_url
failure_cause
filename
generation_logs
meta
payload
preview_url
public_share_link
status
updated_at
The DocumentCard object
Attributes
id
app_id
created_at
document_template_id
document_template_identifier
download_url
failure_cause
filename
meta
public_share_link
status
updated_at
Listing Documents
Lists the DocumentCards for your Documents
Query Parameters
Name
Type
Description
Fetching a Document
Fetching a DocumentCard
Fetches the DocumentCard data for a given Document
Path Parameters
Name
Type
Description
Fetching a Document
Fetches the data for a given Document
Path Parameters
Name
Type
Description
Creating a Document
Creates a Document
Headers
Name
Type
Description
Request Body
Name
Type
Description
Example
Attaching meta data to the Document
Generating the Document upon creation
Generating a Document
Updating a Document
Updates an existing Document
Headers
Name
Type
Description
Request Body
Name
Type
Description
Deleting a Document
Deletes a Document
Path Parameters
Name
Type
Description
Last updated
Was this helpful?
