All URIs are relative to https://us1.pdfgeneratorapi.com/api/v4
| Method | HTTP request | Description |
|---|---|---|
| deleteDocument | DELETE /documents/{publicId} | Delete document |
| generateDocument | POST /documents/generate | Generate document |
| generateDocumentAsynchronous | POST /documents/generate/async | Generate document (async) |
| generateDocumentBatch | POST /documents/generate/batch | Generate document (batch) |
| generateDocumentBatchAsynchronous | POST /documents/generate/batch/async | Generate document (batch + async) |
| generateViewerUrl | POST /documents/{publicId} | Get document with prefill |
| getAsyncJobStatus | GET /documents/async/{jobId} | Get job status |
| getDocument | GET /documents/{publicId} | Get document |
| getDocumentActions | GET /documents/{publicId}/actions | Get document actions |
| getDocumentSignatures | GET /documents/{publicId}/signatures | Validate document signatures |
| getDocumentVersions | GET /documents/{publicId}/versions | Get document versions |
| getDocuments | GET /documents | Get documents |
| storeDocument | POST /documents | Store document |
deleteDocument(publicId)
Delete document
Delete document from the Document Storage
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String publicId = "bac8381bce1982e5f6957a0f52371336"; // String | Resource public id
try {
apiInstance.deleteDocument(publicId);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#deleteDocument");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| publicId | String | Resource public id |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 204 | The resource was deleted successfully. | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject9 generateDocument(generateDocumentRequest)
Generate document
Merges template with data and returns base64 encoded document or a public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
GenerateDocumentRequest generateDocumentRequest = new GenerateDocumentRequest(); // GenerateDocumentRequest | Request parameters, including template id, data and formats.
try {
InlineObject9 result = apiInstance.generateDocument(generateDocumentRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#generateDocument");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| generateDocumentRequest | GenerateDocumentRequest | Request parameters, including template id, data and formats. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Document data | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject23 generateDocumentAsynchronous(generateDocumentAsynchronousRequest)
Generate document (async)
Merges template with data as asynchronous job and makes POST request to callback URL defined in the request. Request uses the same format as response of synchronous generation endpoint. The job id is also added to the callback request as header PDF-API-Job-Id Example response from callback URL: ``` { "response": "https://us1.pdfgeneratorapi.com/share/12821/VBERi0xLjcKJeLjz9MKNyAwIG9i\", "meta": { "name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf", "display_name": "a2bd25b8921f3dc7a440fd7f427f90a4", "encoding": "binary", "content-type": "application/pdf" } } ```
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
GenerateDocumentAsynchronousRequest generateDocumentAsynchronousRequest = new GenerateDocumentAsynchronousRequest(); // GenerateDocumentAsynchronousRequest | Request parameters, including template id, data and formats.
try {
InlineObject23 result = apiInstance.generateDocumentAsynchronous(generateDocumentAsynchronousRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#generateDocumentAsynchronous");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| generateDocumentAsynchronousRequest | GenerateDocumentAsynchronousRequest | Request parameters, including template id, data and formats. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Async job response | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject9 generateDocumentBatch(generateDocumentBatchRequest)
Generate document (batch)
Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
GenerateDocumentBatchRequest generateDocumentBatchRequest = new GenerateDocumentBatchRequest(); // GenerateDocumentBatchRequest | Request parameters, including template id, data and formats.
try {
InlineObject9 result = apiInstance.generateDocumentBatch(generateDocumentBatchRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#generateDocumentBatch");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| generateDocumentBatchRequest | GenerateDocumentBatchRequest | Request parameters, including template id, data and formats. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Document data | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject23 generateDocumentBatchAsynchronous(generateDocumentBatchAsynchronousRequest)
Generate document (batch + async)
Merges template with data as asynchronous job and makes POST request to callback URL defined in the request. Request uses the same format as response of synchronous generation endpoint. The job id is also added to the callback request as header PDF-API-Job-Id Example response from callback URL: ``` { "response": "https://us1.pdfgeneratorapi.com/share/12821/VBERi0xLjcKJeLjz9MKNyAwIG9i\", "meta": { "name": "a2bd25b8921f3dc7a440fd7f427f90a4.pdf", "display_name": "a2bd25b8921f3dc7a440fd7f427f90a4", "encoding": "binary", "content-type": "application/pdf" } } ```
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
GenerateDocumentBatchAsynchronousRequest generateDocumentBatchAsynchronousRequest = new GenerateDocumentBatchAsynchronousRequest(); // GenerateDocumentBatchAsynchronousRequest | Request parameters, including template id, data and formats.
try {
InlineObject23 result = apiInstance.generateDocumentBatchAsynchronous(generateDocumentBatchAsynchronousRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#generateDocumentBatchAsynchronous");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| generateDocumentBatchAsynchronousRequest | GenerateDocumentBatchAsynchronousRequest | Request parameters, including template id, data and formats. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Async job response | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
GenerateViewerUrl200Response generateViewerUrl(publicId, generateViewerUrlRequest)
Get document with prefill
Returns a URL for a stored document, optionally with viewer prefill data. The prefill is encrypted server-side and embedded in the viewer URL, so the caller does not have to handle encryption. Prefill is only applied when `output` is `viewer`.
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String publicId = "bac8381bce1982e5f6957a0f52371336"; // String | Resource public id
GenerateViewerUrlRequest generateViewerUrlRequest = new GenerateViewerUrlRequest(); // GenerateViewerUrlRequest | Optional response format and viewer prefill data.
try {
GenerateViewerUrl200Response result = apiInstance.generateViewerUrl(publicId, generateViewerUrlRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#generateViewerUrl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| publicId | String | Resource public id | |
| generateViewerUrlRequest | GenerateViewerUrlRequest | Optional response format and viewer prefill data. | [optional] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Viewer URL response, returned when `output` is `viewer`. | - |
| 201 | Document data | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject13 getAsyncJobStatus(jobId)
Get job status
Returns status of an async job
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String jobId = "968b8a3a-e8ac-49cc-a670-25db545813ed"; // String | Job id
try {
InlineObject13 result = apiInstance.getAsyncJobStatus(jobId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#getAsyncJobStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| jobId | String | Job id |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Async job status | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject11 getDocument(publicId)
Get document
Returns document stored in the Document Storage
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String publicId = "bac8381bce1982e5f6957a0f52371336"; // String | Resource public id
try {
InlineObject11 result = apiInstance.getDocument(publicId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#getDocument");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| publicId | String | Resource public id |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Document data | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject18 getDocumentActions(publicId)
Get document actions
Returns a list of actions performed on a stored document
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String publicId = "bac8381bce1982e5f6957a0f52371336"; // String | Resource public id
try {
InlineObject18 result = apiInstance.getDocumentActions(publicId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#getDocumentActions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| publicId | String | Resource public id |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | A list of document actions | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject17 getDocumentSignatures(publicId, version)
Validate document signatures
Reports on every digital signature a stored document carries: who signed, when a timestamp authority attested it, whether the signed bytes are unchanged and whether the certificate chains to a trusted root. Facts are reported separately from the verdict, because a reader and a validation library can disagree in both directions. `status` reduces them to one answer, worst case first. Each request consumes one credit. A request that reports `unavailable` — signature validation not being enabled on the deployment — validates nothing and is not charged.
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String publicId = "bac8381bce1982e5f6957a0f52371336"; // String | Resource public id
String version = "5f3c2b1a9d8e7f6a"; // String | Which stored version to report on. A version identifier reports on that version, `initial` on the document as first generated. Defaults to the latest version. A version is always reported on as itself: reporting the latest would describe bytes the caller is not holding.
try {
InlineObject17 result = apiInstance.getDocumentSignatures(publicId, version);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#getDocumentSignatures");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| publicId | String | Resource public id | |
| version | String | Which stored version to report on. A version identifier reports on that version, `initial` on the document as first generated. Defaults to the latest version. A version is always reported on as itself: reporting the latest would describe bytes the caller is not holding. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | What the document's signatures say | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 410 | Gone | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject16 getDocumentVersions(publicId)
Get document versions
Returns a list of versions for a stored document
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
String publicId = "bac8381bce1982e5f6957a0f52371336"; // String | Resource public id
try {
InlineObject16 result = apiInstance.getDocumentVersions(publicId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#getDocumentVersions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| publicId | String | Resource public id |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | A list of document versions | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject15 getDocuments(templateId, startDate, endDate, page, perPage)
Get documents
Returns a list of generated documents created by authorized workspace and stored in PDF Generator API. If master user is specified as workspace in JWT then all documents created in the organization are returned. NB! This endpoint returns only documents generated using the output=url option.
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
String startDate = "2022-08-01 12:00:00"; // String | Start date. Format: Y-m-d H:i:s
String endDate = "2022-08-05 12:00:00"; // String | End date. Format: Y-m-d H:i:s. Defaults to current timestamp
Integer page = 1; // Integer | Pagination: page to return
Integer perPage = 15; // Integer | Pagination: How many records to return per page
try {
InlineObject15 result = apiInstance.getDocuments(templateId, startDate, endDate, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#getDocuments");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| templateId | Integer | Template unique identifier | [optional] |
| startDate | String | Start date. Format: Y-m-d H:i:s | [optional] |
| endDate | String | End date. Format: Y-m-d H:i:s. Defaults to current timestamp | [optional] |
| page | Integer | Pagination: page to return | [optional] [default to 1] |
| perPage | Integer | Pagination: How many records to return per page | [optional] [default to 15] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | A list of generated documents | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
InlineObject11 storeDocument(storeDocumentRequest)
Store document
Uploads a PDF as a URL or a base64 encoded string.
// Import classes:
import com.pdfgeneratorapi.client.ApiClient;
import com.pdfgeneratorapi.client.ApiException;
import com.pdfgeneratorapi.client.Configuration;
import com.pdfgeneratorapi.client.auth.*;
import com.pdfgeneratorapi.client.models.*;
import com.pdfgeneratorapi.client.api.DocumentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://us1.pdfgeneratorapi.com/api/v4");
// Configure HTTP bearer authorization: JSONWebTokenAuth
HttpBearerAuth JSONWebTokenAuth = (HttpBearerAuth) defaultClient.getAuthentication("JSONWebTokenAuth");
JSONWebTokenAuth.setBearerToken("BEARER TOKEN");
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
StoreDocumentRequest storeDocumentRequest = new StoreDocumentRequest(); // StoreDocumentRequest | Document source and optional metadata. Exactly one of `file_base64` or `file_url` is required.
try {
InlineObject11 result = apiInstance.storeDocument(storeDocumentRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DocumentsApi#storeDocument");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| storeDocumentRequest | StoreDocumentRequest | Document source and optional metadata. Exactly one of `file_base64` or `file_url` is required. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Document data | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |