Appearance
Getting Started
The PDF Store API is a straightforward RESTful interface to generate PDF Assets. Requests must be authenticated with your API Key which is found on your profile.
Prerequisites
- Obtaining your API Key from your profile.
- Creating a test project and obtaining your
projectId
found on the project detail page.
API Base Url
The API base url for requests is
https://api.pdfstore.dev
Generate a PDF
Using cURL
Ensure you update the <API_KEY>
, <PROJECT_ID>
and <TEMPLATE_URL>
values.
bash
curl -X POST 'https://api.pdfstore.dev/generate' \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"projectId": <PROJECT_ID>, "templateUrl": <TEMPLATE_URL>}'
Using Axios
Ensure you update the <API_KEY>
, <PROJECT_ID>
and <TEMPLATE_URL>
values.
ts
import axios from "axios";
// const projectId = <PROJECT_ID>
// const templateUrl = <TEMPLATE_URL>
// const apiKey = <API_KEY>
async function generatePdf() {
try {
const response = await axios.post(
"https://api.pdfstore.dev/generate",
{
projectId,
templateUrl,
},
{
headers: {
authorization: `Bearer ${apiKey}`,
},
},
);
console.log(response);
} catch (error) {
console.error(error);
}
}