Skip to main content

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)

ParameterTypeDescriptionExample
document*ObjectDocument reference with Name (Excel file name){ "Name": "data.xlsx" }
docContent*String (Base64)Excel document content encoded in Base64UEsDBBQABgAIAAAA...
mergeRowsToExcelAction*ObjectAction configuration. Must contain jsonInput (string) — JSON data to merge as rowsSee Payload example below

Optional Parameters (inside mergeRowsToExcelAction)

ParameterTypeDescriptionExample
worksheetNameStringTarget worksheet nameSheet1
tableNameStringExcel table name for table-based mergeSalesTable
convertNumericAndDateBooleanAutomatic type conversion. Default: truetrue
cultureNameStringCulture for date/number parsingen-US

Output

The API returns the Excel document as a Base64-encoded string in JSON format (document, fileName, success, errorMessage).

Request Example

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}]"
}
}

Code Samples

Get Help