All URIs are relative to https://us1.pdfgeneratorapi.com/api/v3.
Method | HTTP request | Description |
---|---|---|
copyTemplate() | POST /templates/{templateId}/copy | Copy template |
createTemplate() | POST /templates | Create template |
deleteTemplate() | DELETE /templates/{templateId} | Delete template |
getEditorUrl() | POST /templates/{templateId}/editor | Open editor |
getTemplate() | GET /templates/{templateId} | Get template |
getTemplates() | GET /templates | Get templates |
updateTemplate() | PUT /templates/{templateId} | Update template |
copyTemplate($template_id, $name): \PDFGeneratorAPI\Model\InlineResponse2001
Copy template
Creates a copy of a template to the workspace specified in authentication parameters.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$template_id = 19375; // int | Template unique identifier
$name = My copied template; // string | Name for the copied template. If name is not specified then the original name is used.
try {
$result = $apiInstance->copyTemplate($template_id, $name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->copyTemplate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Template unique identifier | |
name | string | Name for the copied template. If name is not specified then the original name is used. | [optional] |
\PDFGeneratorAPI\Model\InlineResponse2001
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createTemplate($template_definition_new): \PDFGeneratorAPI\Model\InlineResponse2001
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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$template_definition_new = new \PDFGeneratorAPI\Model\TemplateDefinitionNew(); // \PDFGeneratorAPI\Model\TemplateDefinitionNew | Template configuration as JSON string
try {
$result = $apiInstance->createTemplate($template_definition_new);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->createTemplate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
template_definition_new | \PDFGeneratorAPI\Model\TemplateDefinitionNew | Template configuration as JSON string |
\PDFGeneratorAPI\Model\InlineResponse2001
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTemplate($template_id): \PDFGeneratorAPI\Model\InlineResponse2002
Delete template
Deletes the template from workspace
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$template_id = 19375; // int | Template unique identifier
try {
$result = $apiInstance->deleteTemplate($template_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->deleteTemplate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Template unique identifier |
\PDFGeneratorAPI\Model\InlineResponse2002
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getEditorUrl($template_id, $body, $language): \PDFGeneratorAPI\Model\InlineResponse2003
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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$template_id = 19375; // int | Template unique identifier
$body = new \stdClass; // object | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
$language = en; // string | Specify the editor UI language. Defaults to organization editor language.
try {
$result = $apiInstance->getEditorUrl($template_id, $body, $language);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->getEditorUrl: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Template unique identifier | |
body | object | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file. | |
language | string | Specify the editor UI language. Defaults to organization editor language. | [optional] |
\PDFGeneratorAPI\Model\InlineResponse2003
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getTemplate($template_id): \PDFGeneratorAPI\Model\InlineResponse2001
Get template
Returns template configuration
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$template_id = 19375; // int | Template unique identifier
try {
$result = $apiInstance->getTemplate($template_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->getTemplate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Template unique identifier |
\PDFGeneratorAPI\Model\InlineResponse2001
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getTemplates(): \PDFGeneratorAPI\Model\InlineResponse200
Get templates
Returns a list of templates available for the authenticated workspace
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->getTemplates();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->getTemplates: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
\PDFGeneratorAPI\Model\InlineResponse200
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateTemplate($template_id, $template_definition_new): \PDFGeneratorAPI\Model\InlineResponse2001
Update template
Updates template configuration. The template configuration for pages and layout must be complete as the entire configuration is replaced and not merged.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new PDFGeneratorAPI\Api\TemplatesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$template_id = 19375; // int | Template unique identifier
$template_definition_new = new \PDFGeneratorAPI\Model\TemplateDefinitionNew(); // \PDFGeneratorAPI\Model\TemplateDefinitionNew | Template configuration as JSON string
try {
$result = $apiInstance->updateTemplate($template_id, $template_definition_new);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplatesApi->updateTemplate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
template_id | int | Template unique identifier | |
template_definition_new | \PDFGeneratorAPI\Model\TemplateDefinitionNew | Template configuration as JSON string |
\PDFGeneratorAPI\Model\InlineResponse2001
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]