Download the PHP package pdfgeneratorapi/php-client without Composer

On this page you can find all versions of the php package pdfgeneratorapi/php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-client

PDFGeneratorAPI

Introduction

PDF Generator API allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor.

The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding.

Base URL

The base URL for all the API endpoints is https://us1.pdfgeneratorapi.com/api/v4

For example

Editor

PDF Generator API comes with a powerful drag & drop editor that allows to create any kind of document templates, from barcode labels to invoices, quotes and reports. You can find tutorials and videos from our Support Portal.

Definitions

Organization

Organization is a group of workspaces owned by your account.

Workspace

Workspace contains templates. Each workspace has access to their own templates and organization default templates.

Master Workspace

Master Workspace is the main/default workspace of your Organization. The Master Workspace identifier is the email you signed up with.

Default Template

Default template is a template that is available for all workspaces by default. You can set the template access type under Page Setup. If template has "Organization" access then your users can use them from the "New" menu in the Editor.

Data Field

Data Field is a placeholder for the specific data in your JSON data set. In this example JSON you can access the buyer name using Data Field {paymentDetails::buyerName}. The separator between depth levels is :: (two colons). When designing the template you don’t have to know every Data Field, our editor automatically extracts all the available fields from your data set and provides an easy way to insert them into the template.

Rate limiting

Our API endpoints use IP-based rate limiting and allow you to make up to 2 requests per second and 60 requests per minute. If you make more requests, you will receive a response with HTTP code 429.

Response headers contain additional values:

Header Description
X-RateLimit-Limit Maximum requests per minute
X-RateLimit-Remaining The requests remaining in the current minute
Retry-After How many seconds you need to wait until you are allowed to make requests

Libraries and SDKs

Postman Collection

We have created a Postman Collection so you can easily test all the API endpoints without developing and code. You can download the collection here or just click the button below.

Run in Postman

Client Libraries

All our Client Libraries are auto-generated using OpenAPI Generator which uses the OpenAPI v3 specification to automatically generate a client library in specific programming language.

We have validated the generated libraries, but let us know if you find any anomalies in the client code.


Authentication

The PDF Generator API uses JSON Web Tokens (JWT) to authenticate all API requests. These tokens offer a method to establish secure server-to-server authentication by transferring a compact JSON object with a signed payload of your account’s API Key and Secret. When authenticating to the PDF Generator API, a JWT should be generated uniquely by a server-side application and included as a Bearer Token in the header of each request.

Accessing your API Key and Secret

You can find your API Key and API Secret from the Account Settings page after you login to PDF Generator API here.

Creating a JWT

JSON Web Tokens are composed of three sections: a header, a payload (containing a claim set), and a signature. The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding.

The JWT's header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form:

We recommend and support libraries provided on jwt.io. While other libraries can create JWT, these recommended libraries are the most robust.

Header

Property alg defines which signing algorithm is being used. PDF Generator API users HS256. Property typ defines the type of token and it is always JWT.

Payload

The second part of the token is the payload, which contains the claims or the pieces of information being passed about the user and any metadata required. It is mandatory to specify the following claims:

  • issuer (iss): Your API key
  • subject (sub): Workspace identifier
  • expiration time (exp): Timestamp (unix epoch time) until the token is valid. It is highly recommended to set the exp timestamp for a short period, i.e. a matter of seconds. This way, if a token is intercepted or shared, the token will only be valid for a short period of time.

Signature

To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is.

Putting all together

The output is three Base64-URL strings separated by dots. The following shows a JWT that has the previous header and payload encoded, and it is signed with a secret.

Temporary JWTs

You can create a temporary token in Account Settings page after you login to PDF Generator API. The generated token uses your email address as the subject (sub) value and is valid for 15 minutes. You can also use jwt.io to generate test tokens for your API calls. These test tokens should never be used in production applications.


Error codes

Code Description
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
422 Unprocessable Entity
429 Too Many Requests
500 Internal Server Error

401 Unauthorized

Description
Authentication failed: request expired
Authentication failed: workspace missing
Authentication failed: key missing
Authentication failed: property 'iss' (issuer) missing in JWT
Authentication failed: property 'sub' (subject) missing in JWT
Authentication failed: property 'exp' (expiration time) missing in JWT
Authentication failed: incorrect signature

402 Payment Required

Description
Your account is suspended, please upgrade your account

403 Forbidden

Description
Your account has exceeded the monthly document generation limit.
Access not granted: You cannot delete master workspace via API
Access not granted: Template is not accessible by this organization
Your session has expired, please close and reopen the editor.

404 Entity not found

Description
Entity not found
Resource not found
None of the templates is available for the workspace.

422 Unprocessable Entity

Description
Unable to parse JSON, please check formatting
Required parameter missing
Required parameter missing: template definition not defined
Required parameter missing: template not defined

429 Too Many Requests

Description
You can make up to 2 requests per second and 60 requests per minute.

For more information, please visit https://support.pdfgeneratorapi.com.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

Then run composer install

Manual Installation

Download the files and include autoload.php:

Getting Started

Please follow the installation procedure and then run the following:

API Endpoints

All URIs are relative to https://us1.pdfgeneratorapi.com/api/v4

Class Method HTTP request Description
ConversionApi convertHTML2PDF POST /conversion/html2pdf HTML to PDF
ConversionApi convertURL2PDF POST /conversion/url2pdf URL to PDF
DocumentsApi generateDocument POST /documents/generate Generate document
DocumentsApi generateDocumentAsynchronous POST /documents/generate/async Generate document (async)
DocumentsApi generateDocumentBatch POST /documents/generate/batch Generate document (batch)
DocumentsApi generateDocumentBatchAsynchronous POST /documents/generate/batch/async Generate document (batch + async)
DocumentsApi getDocuments GET /documents Get documents
TemplatesApi copyTemplate POST /templates/{templateId}/copy Copy template
TemplatesApi createTemplate POST /templates Create template
TemplatesApi deleteTemplate DELETE /templates/{templateId} Delete template
TemplatesApi getTemplate GET /templates/{templateId} Get template
TemplatesApi getTemplateData GET /templates/{templateId}/data Get template data fields
TemplatesApi getTemplates GET /templates Get templates
TemplatesApi openEditor POST /templates/{templateId}/editor Open editor
TemplatesApi updateTemplate PUT /templates/{templateId} Update template
WorkspacesApi createWorkspace POST /workspaces Create workspace
WorkspacesApi deleteWorkspace DELETE /workspaces/{workspaceIdentifier} Delete workspace
WorkspacesApi getWorkspace GET /workspaces/{workspaceIdentifier} Get workspace
WorkspacesApi getWorkspaces GET /workspaces Get workspaces

Models

  • AsyncOutputParam
  • CallbackParam
  • Component
  • ConvertHTML2PDFRequest
  • ConvertURL2PDFRequest
  • CopyTemplateRequest
  • CreateTemplate201Response
  • CreateWorkspace201Response
  • CreateWorkspaceRequest
  • DataBatchInner
  • DeleteTemplate204Response
  • DeleteTemplate204ResponseResponse
  • Document
  • FormatParam
  • GenerateDocument201Response
  • GenerateDocument201ResponseMeta
  • GenerateDocumentAsynchronous201Response
  • GenerateDocumentAsynchronous201ResponseResponse
  • GenerateDocumentAsynchronousRequest
  • GenerateDocumentBatchAsynchronousRequest
  • GenerateDocumentBatchRequest
  • GenerateDocumentRequest
  • GetDocuments200Response
  • GetTemplateData200Response
  • GetTemplates200Response
  • GetTemplates401Response
  • GetTemplates402Response
  • GetTemplates403Response
  • GetTemplates404Response
  • GetTemplates422Response
  • GetTemplates429Response
  • GetTemplates500Response
  • GetWorkspaces200Response
  • OpenEditor200Response
  • OpenEditorRequest
  • OpenEditorRequestData
  • OutputParam
  • PaginationMeta
  • Template
  • TemplateDefinition
  • TemplateDefinitionDataSettings
  • TemplateDefinitionEditor
  • TemplateDefinitionNew
  • TemplateDefinitionNewLayout
  • TemplateDefinitionNewLayoutMargins
  • TemplateDefinitionNewLayoutRepeatLayout
  • TemplateDefinitionNewPagesInner
  • TemplateDefinitionNewPagesInnerMargins
  • TemplateParam
  • TemplateParamData
  • Workspace

Authorization

JSONWebTokenAuth

  • Type: Bearer authentication (JWT)

Tests

To run the tests, use:

Author

[email protected]

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 4.0.3
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

All versions of php-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pdfgeneratorapi/php-client contains the following files

Loading the files please wait ....