Skip to content

Instantly share code, notes, and snippets.

@fernandomitre7
Last active March 4, 2016 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fernandomitre7/88c0c627119985fb15b3 to your computer and use it in GitHub Desktop.
Save fernandomitre7/88c0c627119985fb15b3 to your computer and use it in GitHub Desktop.
New complex merge, schema structure example.
{
"sections": [
{
"url": 'pah/to/template/url.docx',
"template": '(OPTIONAL)BASE64_ENCODED_FILE',
"substitutions": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
},
"tables":[
{
"name": "table name e.g. 'contact' for {#foreach contact}{/foreach contact}",
"rows": [
{
"row1_key1": "row1_value1",
"row1_key2": "row1_value2"
},
{
"row2_key1": "row2_value1",
"row2_key2": "row2_value2"
}
]
},
{...}
]
},
{
"url": 'pah/to/template/url.docx',
"template": '(OPTIONAL)BASE64_ENCODED_FILE',
"substitutions": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
},
"tables":[
{
"name": "table name e.g. 'contact' for {#foreach contact}{/foreach contact}",
"rows": [
{
"row1_key1": "row1_value1",
"row1_key2": "row1_value2"
},
{
"row2_key1": "row2_value1",
"row2_key2": "row2_value2"
}
]
},
{...}
]
},
{ ... }
],
"output": 'BASE64_ENCODED_OUTPUT_FILE'',
"output_type": enum: ['doc', 'pdf']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment