Templates

Document builder with sections


Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
body body CreateTemplateRequest true Metadata for creating a template from language sections.

Request body - instance of CreateTemplateRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "templateName": "convergentes",
  "defaultLanguage": "ES",
  "orderedSectionNames": [
    "introduction",
    "personal_data",
    "anexo_gdpr"
  ],
  "rules": [
    {
      "sectionExternalId": "contract_gdpr",
      "condition": "GDPR:YES"
    }
  ]
}
Name Type Required Description
templateName string true name of template of sections (will be normalized on template external Id)
defaultLanguage Language true Templates languages allowed
Allowed values: ES, EN, EU, GL, CA, DE, UNDEFINED
orderedSectionNames OrderedSectionNames true list sections external Ids that belongs to the template IN THE ORDER in which they should be concatenated when filled
rules Rules false defines conditions rules that have to be matched in fill flags values, to allow this section to be filled

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20

curl -X POST https://documents.masstack.com/v1/orgs/masmovil/templates \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
 --data-raw "{
  'templateName': 'convergentes',
  'defaultLanguage': 'ES',
  'orderedSectionNames': [
    'introduction',
    'personal_data',
    'anexo_gdpr'
  ],
  'rules': [
    {
      'sectionExternalId': 'contract_gdpr',
      'condition': 'GDPR:YES'
    }
  ]
}" 

Responses

Code Meaning Description Schema
201 Created New template is created. Expected response for a valid request. TemplateMetadata
204 No Content Template created successfully. None
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
409 Conflict Conflict. Resource already exits None
410 Gone resource is not longer available None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
page query Page false Defines templates page number to be show. If not defined, default value is 0 (first page).
pageSize query PageSize false Defines the number of templates returned in each page. If not defined, default value is 50.

Request example

1
2
3
4

curl -X GET https://documents.masstack.com/v1/orgs/masmovil/templates?page='0'&pageSize='1' \
  -H "Accept: application/json"

Responses

Code Meaning Description Schema
200 OK The templates metadata is returned. Expected response for a valid request. AllTemplatesResponse
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
templateExternalId path string true The external id of the template
body body UpgradeTemplateRequest true Metadata for upgrading a template from language sections

Request body - instance of UpgradeTemplateRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "defaultLanguage": "ES",
  "orderedSectionNames": [
    "introduction",
    "personal_data",
    "anexo_gdpr"
  ],
  "rules": [
    {
      "sectionExternalId": "contract_gdpr",
      "condition": "GDPR:YES"
    }
  ],
  "changelog": "Added new GDPR descriptive text and formatting changes to the contract."
}
Name Type Required Description
defaultLanguage Language true Templates languages allowed
Allowed values: ES, EN, EU, GL, CA, DE, UNDEFINED
orderedSectionNames OrderedSectionNames true list sections external Ids that belongs to the template IN THE ORDER in which they should be concatenated when filled
rules Rules false defines conditions rules that have to be matched in fill flags values, to allow this section to be filled
changelog string false none

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20

curl -X POST https://documents.masstack.com/v1/orgs/masmovil/templates/contract_sales/versions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
 --data-raw "{
  'defaultLanguage': 'ES',
  'orderedSectionNames': [
    'introduction',
    'personal_data',
    'anexo_gdpr'
  ],
  'rules': [
    {
      'sectionExternalId': 'contract_gdpr',
      'condition': 'GDPR:YES'
    }
  ],
  'changelog': 'Added new GDPR descriptive text and formatting changes to the contract.'
}" 

Responses

Code Meaning Description Schema
201 Created New version template is created. Expected response for a valid request. TemplateMetadata
204 No Content Template upgraded successfully. None
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
templateExternalId path string true The external id of the template
version path integer true version of the template to be updated

Request example

1
2
3
4

curl -X DELETE https://documents.masstack.com/v1/orgs/masmovil/templates/convergente_particulares/versions/1/minor \
  -H "Accept: application/json"

Responses

Code Meaning Description Schema
204 No Content Template deleted successfully. None
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
409 Conflict Conflict. Minor version can not be deleted None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
templateExternalId path string true The external id of the template
version path integer true version of the template to be updated
body body UpdateTemplateRequest true Metadata for upgrading a template from language sections

Request body - instance of UpdateTemplateRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "defaultLanguage": "ES",
  "orderedSectionNames": [
    "introduction",
    "personal_data",
    "anexo_gdpr"
  ],
  "rules": [
    {
      "sectionExternalId": "contract_gdpr",
      "condition": "GDPR:YES"
    }
  ],
  "changelog": "Template change reason description."
}
Name Type Required Description
defaultLanguage Language false Templates languages allowed
Allowed values: ES, EN, EU, GL, CA, DE, UNDEFINED
orderedSectionNames OrderedSectionNames false list sections external Ids that belongs to the template IN THE ORDER in which they should be concatenated when filled
rules Rules false defines conditions rules that have to be matched in fill flags values, to allow this section to be filled
changelog string false none

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20

curl -X PATCH https://documents.masstack.com/v1/orgs/masmovil/templates/convergente_particulares/versions/1 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
 --data-raw "{
  'defaultLanguage': 'ES',
  'orderedSectionNames': [
    'introduction',
    'personal_data',
    'anexo_gdpr'
  ],
  'rules': [
    {
      'sectionExternalId': 'contract_gdpr',
      'condition': 'GDPR:YES'
    }
  ],
  'changelog': 'Template change reason description.'
}" 

Responses

Code Meaning Description Schema
201 Created Version template is updated. Expected response for a valid request. TemplateMetadata
204 No Content Template updated successfully. None
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
409 Conflict Conflict. Resource already exits None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
x-auth-owner header string false The string id related with the document owner. It is mandatory when document is not public
org_id path string true The string id related with one of Grupo MasOrange tenants
templateExternalId path string true The external id of the template
version path integer true version of the template to be updated
body body FillTemplateDocumentsRequest true Metadata to fill a template

Request body - instance of FillTemplateDocumentsRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "language": "ES",
  "flagsConditions": [
    "GDPR:YES",
    "PREVIEW:ALLOW"
  ],
  "fieldsValues": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "name": "personal_contract",
  "tags": [
    "DRAFT"
  ],
  "fillMode": "default",
  "flatten": true
}
Name Type Required Description
language Language true Templates languages allowed
Allowed values: ES, EN, EU, GL, CA, DE, UNDEFINED
flagsConditions Conditions false list of conditions which trigger specific sections of the template to be filled
fieldsValues FieldsValues true form variables whose values will be printed in the filled form
name string false Name of the document (without spaces). The document is renamed with this value.
tags Tags false Five free values (user-defined) to tag form. These values are normalized following the next rules:
- All tags will be converted to uppercase
- All whitespaces will be removed
- Empty or blank tags are not allowed
- Tags matching reserved words (null, undefined or nan) are not allowed
fillMode FillMode false Allowed values: ‘default’, ‘raw’
Describes character’s filter process to execute when fill a form/template:
- ‘default’ (also when no value or unrecognized value): all non alfa-numeric characters are escaped and replaced by ‘?'
- ‘raw’: like ‘default’ but ‘tabulation’ and ‘end of line’ characters are allowed
flatten Flatten false Describes if the filled template will be flattened or not.

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

curl -X POST https://documents.masstack.com/v1/orgs/masmovil/templates/contract_sales/versions/1/fill/documents \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "x-auth-owner: 2357893" \
 --data-raw "{
  'language': 'ES',
  'flagsConditions': [
    'GDPR:YES',
    'PREVIEW:ALLOW'
  ],
  'fieldsValues': [
    {
      'name': 'string',
      'value': 'string'
    }
  ],
  'name': 'personal_contract',
  'tags': [
    'DRAFT'
  ],
  'fillMode': 'default',
  'flatten': true
}" 

Responses

Code Meaning Description Schema
200 OK The filled template as pdf document. Expected response to a valid request. FillTemplateDocumentsResponse
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
410 Gone resource is not longer available None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
templateExternalId path string true The external id of the desired template
version path integer true version of the template
include query string false Define extra options to include in response. Values:
* ‘history’: return all versions (previous minor versions) of a major template version

Request example

1
2
3
4

curl -X GET https://documents.masstack.com/v1/orgs/masmovil/templates/ifcc_template/versions/1/metadata?include='include=history' \
  -H "Accept: application/json"

Responses

Code Meaning Description Schema
200 OK The template metadata is returned. Expected response for a valid request. TemplateMetadataResponse
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
410 Gone resource is not longer available None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Parameters

Name In Type Required Description
org_id path string true The string id related with one of Grupo MasOrange tenants
templateExternalId path string true The external id of the desired template

Request example

1
2
3
4

curl -X GET https://documents.masstack.com/v1/orgs/masmovil/templates/ifcc_template/changelog \
  -H "Accept: application/json"

Responses

Code Meaning Description Schema
200 OK The template changelog history is returned. Expected response for a valid request. TemplateChangelogHistoryResponse
400 Bad Request Request input is not valid None
401 Unauthorized Unauthorized. AuthN and AuthZ validations have fail None
404 Not Found resource not found None
410 Gone resource is not longer available None
500 Internal Server Error Not expected error None
default Default Error response ErrorsResponse

Endpoints

Documents

    Forms

      Sections

        Templates

          Templates Configuration

            Digital Sign Process

              Biometric Signature

                Simple Signature

                  Identification Agent

                    Sign Configuration

                      Identification OTP

                        Identification Agent Admin

                          Identification OTP Admin

                            Contracts

                              Scoring

                                Securize