メインコンテンツへスキップ

行を更新 Excel

PDF4me 行を更新する は REST 書き込みを行うエンドポイント JSON データを既存の行に挿入する Excel ワークブック。 POST .xlsx を Base64 に office/ApiV2Excel/ExcelUpdateRows データと共に jsonInput、対象行 Excel テーブル名または1ベースの座標で指定し、更新されたワークブックをデコードします。 JSON 応答。数値と日付の変換はデフォルトで自動的に行われます。

このエンドポイントの機能

ワークブックと JSON オブジェクトの配列を取得し、それらの値を既存の行に書き込みます。料金表の価格を更新したり、レポートのレコードを修正したり、 CRM2 つのターゲティング モードのいずれかを使用して、データの送信先を選択します。 Excel テーブルまたは正確な行と列の座標。応答は JSON 更新されたワークブックとして Base64 コンテンツ。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

毎 PDF4me REST 電話にはあなたの API キー Authorization ヘッダーを基本認証として設定します。開発者ダッシュボードからキーを取得またはローテーションしてください。

終点​

POSToffice/ApiV2Excel/ExcelUpdateRows

見逃してはならない重要な事実​

jsonInput は文字列であり、 JSON 配列
更新データはエスケープされた形式で送信されます JSON 内部のストリング jsonInputこのエンドポイントで400エラーが発生する最も一般的な原因は、生の配列を送信することです。まずシリアライズしてから埋め込んでください。
tableNameによって選択された2つのターゲティングモード
空でない テーブル名 テーブルモードに切り替えて excelRowNumber; 空欄の場合は座標モードを意味します insertFromRow/insertFromColumnすべてのポジションは1ベースです。
回答は Base64 JSONファイルではなく
更新されたワークブックは Base64 内部のストリング JSON ボディ fileName、 success、 そして エラーメッセージ保存する前にデコードしてください。生のレスポンスは有効な .xlsx ファイルではありません。

HTTP 設定​

方法: POST
URL: https://api.pdf4me.com/office/ApiV2Excel/ExcelUpdateRows
コンテンツタイプ: アプリケーション/json
Authorization: 基本 <あなたの PDF4me API キー>

回答は JSON: チェック success フラグを立てて、それから Base64返されたワークブックの内容をデコードして保存します。 .xlsx 拡大。

テーブルモードと座標モードのどちらを使うべきでしょうか?​

これら2つのモードは異なるワークシートレイアウトに対応しており、どちらかを間違えて選択すると、更新内容が間違ったセルに反映されてしまうのが一般的です。

テーブルモードと座標モードの比較テーブルモード座標モード
選び方セット tableName 指定された Excel テーブル離れる tableName 空の
データがどこに着地するか行 excelRowNumber テーブル内(1ベース)開始価格 insertFromRow/insertFromColumn (1を基数としているので、1/1はA1です)
列のマッチングJSON プロパティ名はテーブルの列ヘッダーに対応します値は開始列から左から右に書き込まれます
レイアウト変更にも耐えるはい、テーブルが移動すれば、更新もそれに従います。いいえ、座標は固定位置です
最適実際の例を含む構造化されたワークシート Excel テーブルプレーンレンジとアドホックシート

API ボディフィールド​

パラメータ必須その機能例
documentRequiredSource file. `Name` must end in `.xlsx`, `.xls` or `.xlsm` (a `.csv` for `ExcelParseCsv`).{ "Name": "data.xlsx" }
document.NameRequiredFile name including its extension. Type: string.{ "Name": "data.xlsx" }
docContentRequiredThe source file, base64-encoded. Type: string.UEsDBBQABgAIAAAA...
isAsyncOptionalProcess the request in the background. The call returns `202 Accepted`; poll the `Location` URL (`GetActionStatus`) for the result. Type: boolean.
updateRowsToExcelActionRequiredObject carrying this operation's settings. Its fields are the updateRowsToExcelAction rows below.{ "jsonInput": "..." }
updateRowsToExcelAction.jsonDataOptionalThe new values, as a JSON array of objects encoded in a string. Type: string.
updateRowsToExcelAction.worksheetNameOptionalThe sheet to update. Type: string.
updateRowsToExcelAction.startRowOptional1-based first row to write to. Type: integer.
updateRowsToExcelAction.startColumnOptional1-based first column to write to. Type: integer.
updateRowsToExcelAction.convertNumericAndDateOptionalStore numbers and dates as real Excel values. Type: boolean.
updateRowsToExcelAction.dateFormatOptionalFormat for date values. Type: string.
updateRowsToExcelAction.numericFormatOptionalFormat for numbers. Type: string.
updateRowsToExcelAction.ignoreNullValuesOptionalLeave a cell unchanged when its value is `null`. Type: boolean.
updateRowsToExcelAction.cultureNameOptionalCulture used to format numbers and dates. Type: string.

サンプルペイロード​

テーブルモード:名前付きテーブルの5行目を更新する​

{
"document": { "Name": "sales.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"updateRowsToExcelAction": {
"jsonInput": "[{\"Region\":\"EMEA\",\"Revenue\":125000}]",
"worksheetName": "Q3",
"tableName": "SalesTable",
"excelRowNumber": 5
}
}

座標モード:セルA10から書き込みを開始します​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"updateRowsToExcelAction": {
"jsonInput": "[{\"Name\":\"John\",\"Age\":31},{\"Name\":\"Ana\",\"Age\":28}]",
"insertFromRow": 10,
"insertFromColumn": 1,
"convertNumericAndDate": true,
"cultureName": "en-US"
}
}

郵便配達員の集荷に関するヒント​

Headers
Content-Type: application/json + Authorization: Basic <apiKey>.
Body
raw JSON. jsonInput must be a string: escape the inner quotes or use your HTTP library to serialize the array first, then assign it as a string.
Targeting
tableName set = table mode with excelRowNumber. tableName empty = coordinate mode with insertFromRow/insertFromColumn. Both are 1-based.
Response
JSON with a success flag and Base64 workbook content. Decode the document field before saving as .xlsx.

curlの例​

curl -X POST https://api.pdf4me.com/office/ApiV2Excel/ExcelUpdateRows \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"document": { "Name": "data.xlsx" },
"docContent": "'"$(base64 -w 0 data.xlsx)"'",
"updateRowsToExcelAction": {
"jsonInput": "[{\"Name\":\"John\",\"Age\":31}]",
"insertFromRow": 10,
"insertFromColumn": 1
}
}' \
--output response.json

何が API 戻る?​

A JSON 更新されたワークブックを結果として Base64。

分野タイプ内容物
documentString (Base64)The updated workbook content. Decode to bytes and save with an .xlsx extension.
fileNameStringOutput filename for the updated workbook.
successBooleantrue when the update succeeded. Check this before decoding content.
errorMessageStringPopulated when success is false: malformed jsonInput, a missing table or worksheet, or invalid Base64.

出力は標準のままです オフィス営業中 XML ワークブックは更新されるため、更新されたセル以外の数式、書式設定、およびシートは変更されません。

コードサンプル​

Excel オフィスエンドポイントはまだパーlanguage サンプルフォルダ。サンプルリポジトリには、すべてのサンプルで使用されるリクエストパターンが含まれています。 PDF4me エンドポイントファミリー:

よくある質問​

Why does the API reject my jsonInput with a 400 error?+
jsonInput is a string field that contains JSON, so the inner quotes must be escaped. Sending a raw JSON array instead of a string-encoded one is the most common cause of a 400 Bad Request on this endpoint.
Should I use table mode or coordinate mode?+
Use table mode (tableName plus excelRowNumber) when the worksheet has a named Excel table: the update follows the table even if it moves. Use coordinate mode (insertFromRow and insertFromColumn, tableName empty) for plain ranges at fixed positions.
Are the row and column numbers 0-based or 1-based?+
1-based. insertFromRow 1 and insertFromColumn 1 address cell A1, and excelRowNumber 1 is the first data row of the table. This differs from some other PDF4me Excel actions where worksheet indexes are 0-based.
Is the response the Excel file itself?+
No. The API returns JSON containing the updated workbook as a Base64 string plus fileName, success, and errorMessage fields. Decode the document field to bytes before saving as .xlsx.
How are numbers and dates handled?+
convertNumericAndDate defaults to true, so values that look like numbers or dates are written as real Excel numbers and dates rather than text. Pair it with cultureName so formats like 31.12.2026 or 12/31/2026 parse correctly.
What is the difference between Update Rows and Add Rows?+
Update Rows overwrites values in rows that already exist at the targeted position. Add Rows appends or inserts new rows. If you point Update Rows at empty cells it simply writes the values there; it does not shift existing data down.
Can I update rows in a protected workbook?+
No. Protection blocks editing. Chain the Unlock Excel action first with the correct password, run the update, then re-apply protection with Secure Excel Document if needed.

アップデートする理由 Excel 行 API 手動で行う代わりに?​

手動で行う方法は、各ワークブックを開き、行を見つけて、値を再入力して保存することです。一度は機能するかもしれませんが、毎晩の同期には機能しません。 CRM またはデータベース。 API ファイルごとに 1 つの決定論的リクエストと同じ編集を行い、 Excel テーブル 無傷で、 Excel サーバーにインストールされています。出力は標準です。 オフィス営業中 XML 次のステップに進むためのワークブックが完成しました。

関連アクション​

他のプラットフォームでも同じタスクを実行​

ヘルプが必要な場合​