Ana içeriğe geç

Satırları Güncelle Excel

PDF4me Satırları Güncelle bir REST yazan uç nokta JSON verileri bir tablonun mevcut satırlarına yerleştirir. Excel çalışma kitabı. POST .xlsx dosyasını şu şekilde Base64 ile office/ApiV2Excel/ExcelUpdateRows verilerinizle birlikte jsonInput, hedef satırlar tarafından Excel tablo adına veya 1 tabanlı koordinatlara göre, daha sonra güncellenmiş çalışma kitabını çözümleyin. JSON Yanıt. Sayısal ve tarihsel dönüştürme varsayılan olarak otomatiktir.

Bu uç noktanın işlevi

Bir çalışma kitabı ve bir JSON Nesne dizisini oluşturur ve bu değerleri mevcut satırlara yazar: fiyat listesindeki fiyatları günceller, rapordaki kayıtları düzeltir, alanları senkronize eder. CRMVerilerin nereye kaydedileceğini, adlandırılmış iki hedefleme modundan biriyle seçersiniz. Excel Tablo veya tam satır ve sütun koordinatları. Yanıt şudur: JSON güncellenmiş çalışma kitabı ile birlikte Base64 içerik.

İlgili Blog Yazıları
Bu özellik için henüz bir blog yazısı yok — yakında yayınlanacak.
Bu arada, her platforma yönelik eğitimler ve iş akışları için PDF4me bloguna göz atın.
Blogu ziyaret edin

Kimliğinizi Doğrulama API Rica etmek

Her PDF4me REST Çağrınızda mutlaka sizin de bulunmanız gerekiyor. API anahtara Authorization Başlıkta Temel kimlik doğrulama (Basic auth) belirtilmiştir. Anahtarınızı geliştirici kontrol panelinden alın veya değiştirin.

Uç nokta

POSTofis/ApiV2Excel/ExcelUpdateRows

Kaçırmamanız Gereken Önemli Bilgiler

jsonInput bir dizedir, bir nesne değildir. JSON sıralamak
Güncelleme verileri, kaçan bir veri gibi hareket eder. JSON içindeki dize jsonGirişiBu uç noktada 400 hatasının en yaygın nedeni ham bir dizi göndermektir. Önce serileştirin, sonra yerleştirin.
TableName tarafından seçilen iki hedefleme modu.
Boş olmayan tabloAdı tablo moduna geçiş yapar excelRowNumber; boş bir tane ise koordinat modu anlamına gelir. Satırdan ekle/Sütundan ekleTüm pozisyonlar 1 tabanlıdır.
Yanıt şudur: Base64 JSONdosya değil
Güncellenmiş çalışma kitabı şu şekilde geri geliyor: Base64 içindeki bir dize JSON vücut ile fileName, success, Ve hataMesajıKaydetmeden önce kodunu çözün; ham yanıt geçerli bir .xlsx dosyası değildir.

HTTP kurmak

Yöntem: POST
URL: https://api.pdf4me.com/office/ApiV2Excel/ExcelUpdateRows
İçerik Türü: uygulama/json
Authorization: Temel <sizin PDF4me API anahtar>

Yanıt şudur: JSON: kontrol edin success bayrak, sonra Base64-Döndürülen çalışma kitabının içeriğini çözün ve bir dosya ile kaydedin. .xlsx eklenti.

Tablo modunu mu yoksa koordinat modunu mu kullanmalıyım?

Bu iki mod farklı çalışma sayfası düzenlerine hizmet eder ve yanlış modu seçmek, güncellemelerin yanlış hücrelere yerleşmesinin en yaygın nedenidir.

Tablo modu ile koordinat modu karşılaştırmasıTablo moduKoordinat modu
Nasıl seçilir?Ayarlamak tableName adı geçen bir kişiye Excel masaAyrılmak tableName boş
Verilerin düştüğü yerSıra excelRowNumber tablonun içinde (1 tabanlı)Başlangıç insertFromRow/insertFromColumn (1 tabanlı, yani 1/1 A1'dir)
Sütun eşleştirmeJSON Özellik adları, tablo sütun başlıklarına karşılık gelir.Değerler başlangıç sütunundan soldan sağa doğru yazılmıştır.
Yerleşim planı değişikliklerine dayanır.Evet, tablo hareket ederse güncelleme de onu takip eder.Hayır, koordinatlar sabit konumlardır.
En iyisiGerçekçi yapılandırılmış çalışma sayfaları. Excel tablolarDüz aralıklar ve geçici sayfalar

API vücut alanları

ParametreGerekliTipNe işe yarar?Örnek
documentRequiredobjectDocument reference carrying Name, the Excel filename with its extension.{ "Name": "data.xlsx" }
docContentRequiredstringBase64-encoded bytes of the workbook to update.UEsDBBQABgAIAAAA...
updateRowsToExcelActionRequiredobjectAction configuration object holding jsonInput and all targeting options below.{ "jsonInput": "..." }
jsonInputRequiredstringInside the action object. A STRING containing an escaped JSON array of objects; property names become column targets in table mode."[{\"Name\":\"John\",\"Age\":31}]"
worksheetNameOptionalstringInside the action object. Target worksheet; defaults to the first sheet when omitted.Sheet1
tableNameConditionalstringInside the action object. Names the Excel table for table mode. Empty or omitted switches the action to coordinate mode.SalesTable
excelRowNumberConditionalnumberInside the action object. Table mode only: the 1-based row position within the table to update.5
insertFromRowConditionalnumberInside the action object. Coordinate mode only: the 1-based worksheet row where writing starts.10
insertFromColumnConditionalnumberInside the action object. Coordinate mode only: the 1-based worksheet column where writing starts.1
convertNumericAndDateOptionalbooleanInside the action object. true (default) writes numeric-looking and date-looking values as real Excel numbers and dates instead of text.true
cultureNameOptionalstringInside the action object. Culture used to parse dates and numbers, for example en-US or de-DE. Pair with convertNumericAndDate.en-US

Örnek yükler

Tablo modu: adlandırılmış bir tablonun 5. satırını güncelle

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

Koordinat modu: A10 hücresinden başlayarak yaz

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

Postacı tahsilat ipuçları

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 örneği

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

Ne anlama geliyor? API geri dönmek?

A JSON Güncellenmiş çalışma kitabını taşıyan sonuç olarak Base64.

AlanTipİçeriğinde neler var?
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.

Çıktı standart kalır. Ofis Açık XML Çalışma kitabı olduğundan, güncellenen hücrelerin dışındaki formüller, biçimlendirme ve sayfalar dokunulmadan kalır.

Kod örnekleri

Excel Ofis uç noktaları henüz kişi başı fiyatlandırma kapsamına alınmamıştır.language Örnek klasörler; örnekler deposu, her birinin kullandığı istek kalıbını içerir. PDF4me uç nokta ailesi:

SSS

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.

Neden güncelle Excel satırlar aracılığıyla API manuel olarak yapmak yerine mi?

Manuel yöntem, her çalışma kitabını açmak, satırları bulmak, değerleri yeniden yazmak ve kaydetmekten oluşur: bir kez işe yarar, ancak gece senkronizasyonu için işe yaramaz. CRM veya veritabanı. API Dosya başına tek bir deterministik istekle aynı düzenlemeyi yapar, korur Excel tablolar bozulmamış ve asla ihtiyaç duymaz Excel Sunucuya kuruldu. Çıktı standarttır. Ofis Açık XML Çalışma kitabı, süreçteki bir sonraki adım için hazır.

İlgili işlemler

Diğer platformlarda aynı görev

Yardım Alın