BlazingDocs
Search…
Samples
Some useful samples for a single object and array.
As described in previous articles API supports both single object and array (collection, sequence) of objects as input data. Here are some examples of datasets and templates for both cases with simple properties, tables, images, etc.

Single object

Passing a single object the sequence parameter should be false.
curl --location --request POST 'https://api.blazingdocs.com/operation/merge' \
--header 'X-API-Key: bfa1c3ed2c20a8c5cdff00132b7135c3' \
--form 'Data="{\"Date\":\"10/22/2021\",\"Number\":\"#-0000321675\",\"Message\":\"Payment shall be 30 days upon delivery of the above items.\",\"Total\":220,\"Company\":{\"Name\":\"Acme Corporation\",\"Address\":\"1447 Acme Street, Washington\",\"PhoneNumber\":\"(201) 321-5476\",\"EmailAddress\":\"[email protected]\",\"Website\":\"acmecorp.com\"},\"Vendor\":{\"Name\":\"ABC Office Supplies\",\"Responsible\":\"Kate Bening / Sales Department\",\"Address\":\"1667 Abc Street, Washington\",\"PhoneNumber\":\"(202) 321-5476\",\"EmailAddress\":\"[email protected]\",\"Website\":\"abcsupplies.com\"},\"Customer\":{\"Name\":\"Franklin Middle School\",\"Responsible\":\"Helen Wilson / Purchasing Department\",\"Address\":\"1227 Franklin Street, Washington\",\"PhoneNumber\":\"(203) 321-5476\",\"EmailAddress\":\"[email protected]\",\"Website\":\"franklinschool.com\"},\"Signature\":{\"Name\":\"John Smith\",\"Company\":\"Acme Corporation\",\"Title\":\"CEO\"},\"Items\":[{\"No\":\"1\",\"Details\":\"Pencils HB\",\"Unit\":\"Dozen\",\"Quantity\":5,\"UnitPrice\":10,\"Total\":50},{\"No\":\"2\",\"Details\":\"Pencils 2B\",\"Unit\":\"Dozen\",\"Quantity\":4,\"UnitPrice\":10,\"Total\":40},{\"No\":\"3\",\"Details\":\"Pen Ball Blue\",\"Unit\":\"Boxes\",\"Quantity\":10,\"UnitPrice\":10,\"Total\":100},{\"No\":\"4\",\"Details\":\"Paper A4\",\"Unit\":\"Ream\",\"Quantity\":10,\"UnitPrice\":3,\"Total\":30}]}"' \
--form 'OutputName="output.pdf"' \
--form 'MergeParameters="{\"sequence\":false, \"dataSourceType\":\"json\", \"strict\":true}"' \
--form 'Template=@"/C:/BlazingDocs/Templates/PO-Template.docx"'
PO-Template-Dataset.xml
2KB
Text
PO-Template-Dataset.json
2KB
Code
PO-Template.docx
32KB
Binary

Array of objects

Passing an array of objects the sequence parameter should be true, and thedataSourceName parameter should have a value e.g. Persons.
curl --location --request POST 'https://api.blazingdocs.com/operation/merge' \
--header 'X-API-Key: bfa1c3ed2c20a8c5cdff00132b7135c3' \
--form 'Data="[{\"Name\":\"John Smith\",\"Position\":\"Sales Manager\",\"Photo\":\"https://via.placeholder.com/150\",\"Email\":\"[email protected]\"},{\"Name\":\"Mickle Kane\",\"Position\":\"Marketing Manager\",\"Photo\":\"https://via.placeholder.com/150\",\"Email\":\"[email protected]\"},{\"Name\":\"Kate Smith\",\"Position\":\"Sales Manager\",\"Photo\":\"https://via.placeholder.com/150\",\"Email\":\"[email protected]\"}]"' \
--form 'OutputName="output.pdf"' \
--form 'MergeParameters="{\"sequence\":true, \"dataSourceType\":\"json\", \"dataSourceName\":\"data\", \"strict\":true}"' \
--form 'Template=@"/C:/BlazingDocs/Templates/Persons-Template.docx"'
Persons-Template-Dataset.xml
612B
Text
Persons-Template-Dataset.json
484B
Code
Persons-Template-Dataset.csv
285B
Binary
Persons-Template.docx
25KB
Binary

Support

If you have any questions about templates please contact support.
Copy link
On this page
Single object
Array of objects
Support