Quickstart
Welcome to the PDFLoom Quickstart Guide! This section will help you get up and running with the PDFLoom API quickly and easily. Follow the steps below to start converting and screenshotting your content.
Before you can make requests to the PDFloom API, you will need to grab your API key from your dashboard. You can find it under PDFLoom » Keys.
Step 1: Obtain Your API Token
To use the PDFLoom API, you'll need an API token. You can generate your token from the API page in your PDFLoom dashboard.
Step 2: Make Your First API Request
Let's walk through an example of converting HTML content to a PDF using the PDFLoom API.
Example: Convert HTML to PDF
- Endpoint: POST /v1/convert/html
- Authentication: Include your API token in the Authorization header.
curl -X POST https://api.pdfloom.com/v1/convert/html \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"html_content": "<html><body><h1>Hello World</h1></body></html>",
"options": {
"page_size": "A4",
"orientation": "portrait"
}
}'
Step 3: Integrate into Your Application
Here's how you can integrate the PDFLoom API into your application.
Convert HTML to PDF
curl -X POST https://api.pdfloom.com/v1/convert/html \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"html_content": "<html><body><h1>Hello World</h1></body></html>",
"options": {
"page_size": "A4",
"orientation": "portrait"
}
}'
Take Screenshot of URL
curl -X POST https://api.pdfloom.com/v1/screenshot/url \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": {
"width": 1024,
"height": 768,
"format": "png"
}
}'
What's next?
Great, Now that you've made your first API requests, you can explore the additional functionality of the PDFLoom API, such as converting office documents to PDFs and taking screenshots of HTML content.
Here are a few links that might be handy as you venture further into the PDFLoom API:
- Grab your API key from the PDFLoom dashboard
- Check out the Conversations endpoint
- Learn about the different error messages in PDFLoom
Happy converting!