API Authentication
The PdfBroker.io API uses OAuth 2.0 with the client credentials grant type. You must obtain an access token before making API requests.
Token Endpoint
Request an access token by sending a POST request to the token endpoint:
POST https://login.pdfbroker.io/connect/token
Request Parameters
The request must use Content-Type: application/x-www-form-urlencoded with the following parameters:
| Parameter | Value | Description |
|---|---|---|
client_id |
Your client ID | Found in Members > API |
client_secret |
Your client secret | Found in Members > API |
grant_type |
client_credentials |
OAuth 2.0 grant type |
Example Request
curl -X POST https://login.pdfbroker.io/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=client_credentials"
Example Response
A successful authentication returns a JSON response:
{
"access_token": "<use this value in Authorization header on api requests>",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "pdfbroker"
}
Note
The access token is valid for 3600 seconds (one hour). Request a new token before the current one expires.
Using the Access Token
Include the access token as a Bearer token in the Authorization header for all API requests:
curl -X POST https://api.pdfbroker.io/api/pdf/... \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'