Pdf Weaver API How-To
Our API is live at https://api.pdf-weaver.io/api. Your can get the full OpenApi specification at https://api.pdf-weaver.io/swagger/v1/swagger.json and use the interactive Swagger UI at https://api.pdf-weaver.io/swagger/index.html
Step 1: Obtain a token
Before you can interact with the main Pdf Weaver API, you need to obtain an authentication token. To do this, you have two options:
Option 1: Use the API to get the captcha challenge and solve it manually
- Make a GET request to the
/api/captcha
endpoint to get the captcha challenge:
httpGET https://api.pdf-weaver.io/api/captcha
The API will return a base64-encoded image of the captcha challenge. Decode the base64 string to an image using an online tool like base64.guru.
Solve the captcha challenge manually and note down the solution and the captcha secret.
Call the
/api/token
endpoint with the required parameters:
userId
: Your email address, which will serve as your user ID.captchaSolution
: The solution to the captcha challenge.captchaSecret
: The captcha secret associated with the captcha challenge.
httpGET https://api.pdf-weaver.io/api/token?userId=YOUR_EMAIL_ADDRESS&captchaSolution=CAPTCHA_SOLUTION&captchaSecret=CAPTCHA_SECRET
Upon successful authentication, the API will return a token that you will use in subsequent requests. Additionally, you will receive a confirmation email containing the token.
Option 2: Use the token generation feature on the Pdf Weaver website
Visit the Pdf Weaver Live App at https://pdf-weaver.io/app.
Click "Request New Token" on the top to the right.
Enter your email address as your user ID and solve the captcha challenge provided on the page.
Click the "Generate Token" button.
Upon successful authentication, the website will provide a token that you can use in subsequent requests with the Pdf Weaver API. You will also receive a confirmation email containing the token.
Step 2: Generate a PDF
To generate a PDF using the Pdf Weaver API, make a POST request to the /api/service/order
endpoint with the required request body:
xmlData
: The XML data for the document.xslData
: The XSL data for the document.tokenId
: The token obtained in step 1.userId
: Your user ID.
httpPOST https://api.pdf-weaver.io/api/service/order Content-Type: application/json { "xmlData": "YOUR_XML_DATA", "xslData": "YOUR_XSL_DATA", "tokenId": "YOUR_TOKEN_ID", "userId": "YOUR_USER_ID" }
The API will return a requestId
that you will use in the following steps to check the status and retrieve the generated PDF.
Step 3: Check the status of the PDF generation
To check the status of your PDF generation request, make a GET request to the /api/service/order/state
endpoint with the requestId
obtained in step 2:
httpGET https://api.pdf-weaver.io/api/service/order/state?requestId=YOUR_REQUEST_ID
The API will return the current status of the PDF generation process. Keep polling this endpoint until the status indicates that the process is complete.
Step 4: Retrieve the generated PDF
Once the PDF generation process is complete, make a GET request to the /api/service/order/result
endpoint with the requestId
obtained in step 2:
httpGET https://api.pdf-weaver.io/api/service/order/result?requestId=YOUR_REQUEST_ID
The API will return the generated PDF as a binary file, which you can save and use as needed.
Optional: Get captcha challenge (if required)
If the API requires captcha verification, you can get the captcha challenge by making a GET request to the /api/captcha
endpoint:
httpGET https://api.pdf-weaver.io/api/captcha
Solve the captcha challenge and use the solution and secret in Step 1 to obtain the token.
Optional: Check the API health
To check if the API is up and running, make a GET request to the /api/health
endpoint:
httpGET https://api.pdf-weaver.io/api/health
If the API is healthy, the endpoint will return a 200
status code.