行を追加する - Excel API
PDF4me 行を追加する 挿入できるようになります JSON データを行として Excel 表ベースまたは座標ベースの挿入モードを持つドキュメント。 API このサービスは、自動型変換(文字列から数値/日付)、カルチャ固有の解析、カスタマイズ可能な日付と数値の書式設定、およびnull値の処理をサポートしています。 API 受け取る Excel 文書の内容と JSON データを通じて REST API 通話を利用して Base64 安全なデータ送信のためのエンコード機能。このソリューションは、自動データ入力、レポート生成、データベースからExcelへのワークフローに最適です。
関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →
認証 API リクエスト
あなたの API 認証リクエストにキーを入力してください PDF4me REST API。
主な機能
- 2つの挿入モードテーブルベース(ヘッダーの一致)または座標ベース(正確な行/列の位置指定)
- JSON データサポート: 単一のオブジェクトまたはオブジェクトの配列を挿入します Excel 行
- 自動型変換: 変換する JSON ストリングス Excel 数字と日付
- フォーマットのカスタマイズカスタム日付および数値書式パターンを適用する
- 文化支援指定されたカルチャコードに従って日付と数値を解析します。
- ヌル値の処理null 値をスキップするか、空のセルとして挿入します。
REST API 終点
- 方法: POST
- 終点:
office/ApiV2Excel/ExcelAddRows
REST API パラメータ
重要: アスタリスク (*) が付いているパラメータは必須です。すべてのリクエストで使用されます。 書類、 ドキュメントコンテンツ、 そして addRowsToExcelAction操作固有のパラメータ(jsonInput、worksheetNameなど)は、アクションオブジェクトのプロパティです。
必須パラメータ(ルートレベル)
| パラメータ | 必須 | その機能 | 例 |
|---|---|---|---|
| document | Required | Source file. `Name` must end in `.xlsx`, `.xls` or `.xlsm` (a `.csv` for `ExcelParseCsv`). | { "Name": "data.xlsx" } |
| document.Name | Required | File name including its extension. Type: string. | { "Name": "data.xlsx" } |
| docContent | Required | The source file, base64-encoded. Type: string. | UEsDBBQABgAIAAAA... |
| isAsync | Optional | Process the request in the background. The call returns `202 Accepted`; poll the `Location` URL (`GetActionStatus`) for the result. Type: boolean. | |
| addRowsToExcelAction | Required | Object carrying this operation's settings. Its fields are the addRowsToExcelAction rows below. | See Payload example below |
| addRowsToExcelAction.jsonInput | Required | The rows to add, as a JSON array encoded in a string. Type: string. | |
| addRowsToExcelAction.worksheetName | Optional | The sheet to add rows to. Type: string. | |
| addRowsToExcelAction.insertFromRow | Optional | 1-based row to start inserting at. Required when `tableName` is not set. Type: integer. | |
| addRowsToExcelAction.insertFromColumn | Optional | 1-based column to start inserting at. Required when `tableName` is not set. Type: integer. | |
| addRowsToExcelAction.tableName | Optional | Insert the rows into this Excel table. Use `excelRowNumber` instead of `insertFromRow`/`insertFromColumn`. Type: string. | |
| addRowsToExcelAction.excelRowNumber | Optional | 1-based row position inside the table. Type: integer. | |
| addRowsToExcelAction.convertNumericAndDate | Optional | Store numbers and dates as real Excel values. Type: boolean. | |
| addRowsToExcelAction.dateFormat | Optional | Format for date values. Type: string. | |
| addRowsToExcelAction.numericFormat | Optional | Format for numbers. Type: string. | |
| addRowsToExcelAction.ignoreNullValues | Optional | Skip `null` values. Type: boolean. | |
| addRowsToExcelAction.cultureName | Optional | Culture used to format numbers and dates. Type: string. | |
出力
の API 返します Excel ドキュメントとして Base64-エンコードされた文字列 JSON フォーマット (ドキュメント、ファイル名、成功、エラーメッセージ)。
リクエスト例
ヘッダ
Content-Type: application/json
Authorization: Basic YOUR_BASE64_ENCODED_API_KEY
ペイロード(基本)
{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"addRowsToExcelAction": {
"jsonInput": "[{\"Name\":\"John\",\"Age\":30}]"
}
}