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.
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'
}
]
}"
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"
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
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.'
}"
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"
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
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.'
}"
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
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
}"
Get template changelog history.
keyboard_arrow_down
Get template change log history by template's external id.
GET
/orgs/{org_id}/templates/{templateExternalId}/changelog
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"