Documentation

documentgenerator.template.add

documentgenerator.template.add(fields)

The method adds new template. Returns the same data as when calling the documentgenerator.template.get() on a new template.

File content (parameter file) can be passed via two ways:

  • In the POST query, as base64-encoded (fields[file]);
  • Without encoding in multipart/form-data (as simple file);

Because the UI must be developed independently, field visibility settings (parameter fields[users]) are required for the application itself. The same applies to the sort index (parameter fields[sort]) and activity (parameter fields[active]).

All templates, created via this method are attached to REST module and single provider \Bitrix\DocumentGenerator\DataProvider\Rest.

Parameters

Parameter Description
fieldsarray of template fields, among which:
  • fields[name] - template name (required).
  • fields[file] - file content, encoded in base64 (required). As alternative, file content can be passed in multipart / form-data. In this case, it may not be encoded in base64.
  • fields[numeratorId] - numerator ID (required).
  • fields[region] - country (required).
  • fields[users] - array of accessibility. Empty by default.
  • fields[active] - Y/N active status flag. Default value Y.
  • fields[withStamps] - Y/N put stamps and signatures. Default value N
  • fields[sort] - sorting index.


Examples



© «Bitrix24», 2001-2024