Document Generator

We are still updating this page

Some data may be missing — we will complete it soon.

Permissions

Scope: crm | Who can execute the method: any user

Quick navigation: all methods

The CRM REST methods for documents are implemented through AJAX controllers. The controllers and their actions are implemented in the Document Generator module, while the CRM module only provides the wrapper for them. This wrapper transforms the input and output parameters according to the new REST standard, taking into account the specifics of the CRM module.

When working with document methods through the CRM scope, you can only work with templates/documents linked to the CRM module.

Features of Passed Values

Providers

The Document Generator module uses the full class name as the data provider identifier. Since the CRM module uses named/numeric identifiers to identify entities, a similar syntax was used in REST for documents. If the input parameter is called entityTypeId, it accepts the numeric index of CRM entities. Currently, the following identifiers are available:

  • 1 - lead
  • 2 - deal
  • 3 - contact
  • 4 - company
  • 5 - invoice
  • 7 - estimate
  • 14 - order
  • 31 - new invoices

It is also possible to use SPAs: their entityTypeId is also supported in the Document Generator.

Filtering by Deal Directions

REST methods do not consider the template binding to providers. That is, if a request is sent to generate a document based on a template with a provider to which this template is not linked, there will be no error. It follows that the binding of the template to a specific deal direction is not taken into account. If you want to specify a deal as a provider, only the numeric identifier (2) is indicated.

List of Regions

Each template is linked to a specific country. The list of countries is fixed and currently consists of:

  • de - Germany
  • by - Belarus
  • kz - Kazakhstan
  • ua - Ukraine
  • br - Brazil
  • mx - Mexico
  • uk - United Kingdom
  • pl - Poland

Region management is carried out in the documentgenerator section.

Overview of Methods

Documents

Method

Description

crm.documentgenerator.document.getfields

Document fields.

crm.documentgenerator.document.add

Create a new document.

crm.documentgenerator.document.update

Modify a document.

crm.documentgenerator.document.get

Retrieve information about a document by Id.

crm.documentgenerator.document.list

Get a list of documents.

crm.documentgenerator.document.enablepublicurl

Enable and disable public link to the document.

crm.documentgenerator.document.upload

Upload the generated document and attach it to the specified entity.

crm.documentgenerator.document.delete

Delete a document.

Numerator

Method

Description

crm.documentgenerator.numerator.add

Add a new numerator.

crm.documentgenerator.numerator.update

Modify an existing numerator.

crm.documentgenerator.numerator.get

Retrieve information about a numerator by Id.

crm.documentgenerator.numerator.list

Get a list of numerators.

crm.documentgenerator.numerator.delete

Delete a numerator.

Document Templates

Method

Description

crm.documentgenerator.template.getfields

Document template fields.

crm.documentgenerator.template.add

Add a new template.

crm.documentgenerator.template.update

Modify an existing document template.

crm.documentgenerator.template.get

Retrieve information about a document template by Id.

crm.documentgenerator.template.list

Get a list of document templates.

crm.documentgenerator.template.delete

Delete a document template.