All URIs are relative to https://us1.pdfgeneratorapi.com/api/v4
| Method | HTTP request | Description |
|---|---|---|
| deleteTemplateVersion | DELETE /templates/{templateId}/versions/{templateVersion} | Delete template version |
| getTemplateVersion | GET /templates/{templateId}/versions/{templateVersion} | Get template version |
| listTemplateVersions | GET /templates/{templateId}/versions | List template versions |
| promoteTemplateVersion | PUT /templates/{templateId}/versions/{templateVersion}/promote | Promote template version |
deleteTemplateVersion(template_id, template_version)
Delete template version
Deletes the specified template version. Production versions cannot be deleted.
import PDFGeneratorAPI from 'pdf-generator-api-client';
let defaultClient = PDFGeneratorAPI.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: JSONWebTokenAuth
let JSONWebTokenAuth = defaultClient.authentications['JSONWebTokenAuth'];
JSONWebTokenAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new PDFGeneratorAPI.TemplateVersionsApi();
let template_id = 19375; // Number | Template unique identifier
let template_version = 56; // Number | Unique ID of the template version.
apiInstance.deleteTemplateVersion(template_id, template_version, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | Number | Template unique identifier | |
| template_version | Number | Unique ID of the template version. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
InlineObject16 getTemplateVersion(template_id, template_version)
Get template version
Returns the template definition of the specified version.
import PDFGeneratorAPI from 'pdf-generator-api-client';
let defaultClient = PDFGeneratorAPI.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: JSONWebTokenAuth
let JSONWebTokenAuth = defaultClient.authentications['JSONWebTokenAuth'];
JSONWebTokenAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new PDFGeneratorAPI.TemplateVersionsApi();
let template_id = 19375; // Number | Template unique identifier
let template_version = 56; // Number | Unique ID of the template version.
apiInstance.getTemplateVersion(template_id, template_version, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | Number | Template unique identifier | |
| template_version | Number | Unique ID of the template version. |
- Content-Type: Not defined
- Accept: application/json
TemplateVersionCollection listTemplateVersions(template_id, opts)
List template versions
Returns a paginated list of template versions for the specified template.
import PDFGeneratorAPI from 'pdf-generator-api-client';
let defaultClient = PDFGeneratorAPI.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: JSONWebTokenAuth
let JSONWebTokenAuth = defaultClient.authentications['JSONWebTokenAuth'];
JSONWebTokenAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new PDFGeneratorAPI.TemplateVersionsApi();
let template_id = 19375; // Number | Template unique identifier
let opts = {
'per_page': 56, // Number | Number of items per page.
'page': 56 // Number | Page number to return.
};
apiInstance.listTemplateVersions(template_id, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | Number | Template unique identifier | |
| per_page | Number | Number of items per page. | [optional] |
| page | Number | Page number to return. | [optional] |
- Content-Type: Not defined
- Accept: application/json
PromoteTemplateVersion200Response promoteTemplateVersion(template_id, template_version)
Promote template version
Promotes the specified template version to production. Only one version can be production at a time.
import PDFGeneratorAPI from 'pdf-generator-api-client';
let defaultClient = PDFGeneratorAPI.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: JSONWebTokenAuth
let JSONWebTokenAuth = defaultClient.authentications['JSONWebTokenAuth'];
JSONWebTokenAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new PDFGeneratorAPI.TemplateVersionsApi();
let template_id = 19375; // Number | Template unique identifier
let template_version = 56; // Number | Unique ID of the template version.
apiInstance.promoteTemplateVersion(template_id, template_version, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | Number | Template unique identifier | |
| template_version | Number | Unique ID of the template version. |
PromoteTemplateVersion200Response
- Content-Type: Not defined
- Accept: application/json