All URIs are relative to https://us1.pdfgeneratorapi.com/api/v4
| Method | HTTP request | Description |
|---|---|---|
| copyTemplate | POST /templates/{templateId}/copy | Copy template |
| createTemplate | POST /templates | Create template |
| deleteTemplate | DELETE /templates/{templateId} | Delete template |
| getTemplate | GET /templates/{templateId} | Get template |
| getTemplateData | GET /templates/{templateId}/data | Get template data fields |
| getTemplates | GET /templates | Get templates |
| openEditor | POST /templates/{templateId}/editor | Open editor |
| updateTemplate | PUT /templates/{templateId} | Update template |
| validateTemplate | POST /templates/validate | Validate template |
CreateTemplate201Response copyTemplate(templateId, copyTemplateRequest)
Copy template
Creates a copy of a template to the workspace specified in authentication parameters.
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
CopyTemplateRequest copyTemplateRequest = new CopyTemplateRequest(); // CopyTemplateRequest |
try {
CreateTemplate201Response result = apiInstance.copyTemplate(templateId, copyTemplateRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#copyTemplate");
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 | |
| copyTemplateRequest | CopyTemplateRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Template configuration | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
CreateTemplate201Response createTemplate(templateDefinitionNew)
Create template
Creates a new template. If template configuration is not specified in the request body then an empty template is created. Template is placed to the workspace specified in authentication params. Template configuration must be sent in the request body.
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
TemplateDefinitionNew templateDefinitionNew = new TemplateDefinitionNew(); // TemplateDefinitionNew | Template configuration
try {
CreateTemplate201Response result = apiInstance.createTemplate(templateDefinitionNew);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#createTemplate");
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 |
|---|---|---|---|
| templateDefinitionNew | TemplateDefinitionNew | Template configuration |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Template configuration | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
deleteTemplate(templateId)
Delete template
Deletes the template from workspace
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
try {
apiInstance.deleteTemplate(templateId);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#deleteTemplate");
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 |
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 | - |
CreateTemplate201Response getTemplate(templateId)
Get template
Returns template configuration
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
try {
CreateTemplate201Response result = apiInstance.getTemplate(templateId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#getTemplate");
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 |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Template configuration | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
GetTemplateData200Response getTemplateData(templateId)
Get template data fields
Returns all data fields used in the template. Returns structured JSON data that can be used to check which data fields are used in template or autogenerate sample data.
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
try {
GetTemplateData200Response result = apiInstance.getTemplateData(templateId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#getTemplateData");
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 |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Template data structure | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
GetTemplates200Response getTemplates(name, tags, access, page, perPage)
Get templates
Returns a list of templates available for the authenticated workspace
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
String name = "name_example"; // String | Filter template by name
String tags = "tags_example"; // String | Filter template by tags
String access = "private"; // String | Filter template by access type. No values returns all templates. private - returns only private templates, organization - returns only organization templates.
Integer page = 1; // Integer | Pagination: page to return
Integer perPage = 15; // Integer | Pagination: How many records to return per page
try {
GetTemplates200Response result = apiInstance.getTemplates(name, tags, access, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#getTemplates");
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 |
|---|---|---|---|
| name | String | Filter template by name | [optional] |
| tags | String | Filter template by tags | [optional] |
| access | String | Filter template by access type. No values returns all templates. private - returns only private templates, organization - returns only organization templates. | [optional] [default to ] [enum: private, organization, ] |
| 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 | An array of template objects | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
OpenEditor200Response openEditor(templateId, openEditorRequest)
Open editor
Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application. When using iframe, make sure that your browser allows third-party cookies.
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
OpenEditorRequest openEditorRequest = new OpenEditorRequest(); // OpenEditorRequest |
try {
OpenEditor200Response result = apiInstance.openEditor(templateId, openEditorRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#openEditor");
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 | |
| openEditorRequest | OpenEditorRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns an URL which you can use to redirect your user to the editor or use as iframe source | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
CreateTemplate201Response updateTemplate(templateId, templateDefinitionNew)
Update template
Updates template configuration. The template configuration for pages and layout must be complete as the entire configuration is replaced and not merged.
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
Integer templateId = 19375; // Integer | Template unique identifier
TemplateDefinitionNew templateDefinitionNew = new TemplateDefinitionNew(); // TemplateDefinitionNew | Template configuration
try {
CreateTemplate201Response result = apiInstance.updateTemplate(templateId, templateDefinitionNew);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#updateTemplate");
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 | |
| templateDefinitionNew | TemplateDefinitionNew | Template configuration |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Template configuration | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |
ValidateTemplate200Response validateTemplate(templateDefinitionNew)
Validate template
Validates if the provided template configuration matches the template JSON schema.
// Import classes:
import org.pdfgeneratorapi.client.ApiClient;
import org.pdfgeneratorapi.client.ApiException;
import org.pdfgeneratorapi.client.Configuration;
import org.pdfgeneratorapi.client.auth.*;
import org.pdfgeneratorapi.client.models.*;
import org.pdfgeneratorapi.client.api.TemplatesApi;
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");
TemplatesApi apiInstance = new TemplatesApi(defaultClient);
TemplateDefinitionNew templateDefinitionNew = new TemplateDefinitionNew(); // TemplateDefinitionNew | Template configuration
try {
ValidateTemplate200Response result = apiInstance.validateTemplate(templateDefinitionNew);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TemplatesApi#validateTemplate");
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 |
|---|---|---|---|
| templateDefinitionNew | TemplateDefinitionNew | Template configuration |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Template validation response | - |
| 401 | Unauthorized | - |
| 402 | Account Suspended | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Unprocessable Entity | - |
| 429 | Too Many Requests | - |
| 500 | Internal Server Error | - |