BlazingDocs
Search…
Execute merge
API reference for the "/operation/merge" endpoint. Executes merge operation.

Request

Consumes multipart/form-data, produces application/json.
1
[POST] https://api.blazingdocs.com/operation/merge
Copied!

Form fields

Name
Required
Type
Description
Data
true
string
CSV, JSON, XML string data.
OutputName
true
string
Output filename, extension is required, supported extensions are PDF, DOC, DOCX, ODT.
MergeParameters
true
object
Merge engine parameters object, see details below to get know available parameters.
Template
true
object
Template id, relative path, or file.
The Template parameter may accept form file, template id (can be found in Cloud Console) or relative path (like "/folder1/folder2/template.docx"), so you may choose the most suitable integration option.

Merge parameters

Name
Required
Type
Description
dataSourceType
true
string
Specifies what type of data is passed in data parameter of the request, supported types are CSV, JSON, XML.
dataSourceName
false
string
Name of a data source (collection, e.g. "Persons") in case if you pass an array of objects, required if sequence parameter is true.
sequence
false
bool
True if you pass an array (collection) of objects like "Persons", false if a single object like "Person".
parseColumns
false
bool
True if you have CSV file with column names.
strict
false
bool
True if you want to keep JSON types e.g. "123" will be string, false enables more complex value parsing e.g. "123" will be int in this case.

Example usage

1
curl --location --request POST 'https://api.blazingdocs.com/operation/merge' \
2
--header 'X-API-Key: bfa1c3ed2c20a8c5cdff00132b7135c3' \
3
--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}]}"' \
4
--form 'OutputName="output.pdf"' \
5
--form 'MergeParameters="{\"sequence\":false, \"dataSourceType\":\"json\", \"strict\":true}"' \
6
--form 'Template=@"/C:/BlazingDocs/Templates/PO-Template.docx"'
Copied!

Response

1
{
2
"id": "89edac90-5d5e-45ea-9f4d-b3f86b4b88dc",
3
"type": {
4
"name": "Merge"
5
},
6
"pageCount": 1,
7
"elapsedMilliseconds": 107,
8
"remoteIpAddress": "3.165.10.242",
9
"files": [
10
{
11
"id": "49483596-7f0b-4ae8-a7a8-893755928a0c",
12
"name": "output.pdf",
13
"contentType": "application/pdf",
14
"downloadUrl": "https://s.blazingdocs.com/.../output.pdf",
15
"createdAt": "2021-06-08T15:43:25Z",
16
"lastModifiedAt": "2021-06-08T15:43:25Z",
17
"lastAccessedAt": null,
18
"length": 134145
19
}
20
]
21
}
Copied!
Last modified 6mo ago