Merge Rows - Excel API
PDF4me Merge Rows enables you to merge row data from multiple JSON sources into Excel documents with worksheet and table targeting. This API service processes Excel files and combines row data. The API receives Excel document content and JSON row data through REST API calls, utilizing Base64 encoding for secure transmission. This solution is ideal for data consolidation, report assembly, and automated Excel data workflows.
Authenticating Your API Request
Include your API key in the request to authenticate with the PDF4me REST API.
Key Features
- Row Merging: Combine row data from JSON into Excel tables or ranges
- Worksheet and Table Targeting: Target specific worksheet and optional table name
REST API Endpoint
- Method: POST
- Endpoint:
office/ApiV2Excel/ExcelMergeRows
REST API Parameters
Important: Parameters marked with an asterisk (*) are required. All requests use document, docContent, and mergeRowsToExcelAction. Operation-specific parameters (jsonInput, worksheetName, etc.) are properties of the action object.
Required Parameters (root level)
| Parameter | Type | Description | Example |
|---|---|---|---|
| document* | Object | Document reference with Name (Excel file name) | { "Name": "data.xlsx" } |
| docContent* | String (Base64) | Excel document content encoded in Base64 | UEsDBBQABgAIAAAA... |
| mergeRowsToExcelAction* | Object | Action configuration. Must contain jsonInput (string) — JSON data to merge as rows | See Payload example below |
Optional Parameters (inside mergeRowsToExcelAction)
| Parameter | Type | Description | Example |
|---|---|---|---|
| worksheetName | String | Target worksheet name | Sheet1 |
| tableName | String | Excel table name for table-based merge | SalesTable |
| convertNumericAndDate | Boolean | Automatic type conversion. Default: true | true |
| cultureName | String | Culture for date/number parsing | en-US |
Output
The API returns the Excel document as a Base64-encoded string in JSON format (document, fileName, success, errorMessage).
Request Example
Header
Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY
Payload (Basic)
{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"mergeRowsToExcelAction": {
"jsonInput": "[{\"Name\":\"John\",\"Age\":30}]"
}
}