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

ロック解除 Excel

PDF4me ロック解除 Excel は REST パスワード保護を解除するエンドポイント Excel 正しいパスワードを入力すると、ワークブックが表示されます。 POST 保護されたファイルとして Base64 に office/ApiV2Excel/ExcelUnlockパスワードを中に入力してください unlockExcelAction、そして、デコードされた保護されていないコピーを JSON 応答。保護を解除するだけで、決して突破することはありません。

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

保護されたワークブックとそのパスワードを受け取り、保護されていないコピーを返します。ファイル暗号化、ワークブック構造保護、ワークシートロックはすべて一度に解除されるため、自動化されたパイプラインがセルを読み取り、行を追加し、ファイルをマージする前に必要な処理となります。 Excel アクションは保護されていないワークブックを想定しています。応答は JSON 結果として Base64 コンテンツ。

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

認証 API リクエスト​

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

終点​

POSToffice/ApiV2Excel/ExcelUnlock

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

正しいパスワードが必要です。クラッカーではありません。
の API 保護を適用するために使用したパスワードを入力すると、保護が解除されます。未知のパスワードをバイパス、復元、または総当たり攻撃することはできません。間違ったパスワードを入力すると、 success: 間違い。
ペイロードにパスワードをハードコーディングしてはいけません。
リクエストボディはスクリプト、ログ、バージョン管理システムに書き込まれます。 unlockExcelAction.password 環境変数またはシークレットマネージャーから取得した認証情報の場合、他の認証情報と同様のルールが適用されます。
まずロックを解除し、次に自動化する
他の Excel (行の追加、ワークシートの抽出、ファイルの結合などの)操作は、保護されていないワークブックを前提としています。ExcelUnlockを最初のステップとして実行し、その出力を後続の処理に渡してください。

HTTP 設定​

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

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

ロック解除すると、どのような保護機能が解除されますか?​

Excel 保護は多層構造になっており、各層の動作は異なります。正しいパスワードでロックを解除すると、すべての保護が一度に解除されます。

保護と行動ブロックするものこれにより削除されました API
ファイル暗号化パスワードなしでファイルを開くことはい、正しいパスワードで
ワークブック構造の保護シートの追加、削除、または並べ替えはい
ワークシート保護ロックされたシートのセルを編集するはい
不明なパスワード上記すべていいえ。正しいパスワードが必要です。

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.
unlockExcelActionRequiredObject carrying this operation's settings. Its fields are the unlockExcelAction rows below.{ "password": "..." }
unlockExcelAction.secureOnOpenPasswordOptionalThe password that opens the file. Type: string.
unlockExcelAction.workbookProtectionPasswordOptionalThe workbook structure password. Type: string.
unlockExcelAction.worksheetProtectionPasswordOptionalThe sheet protection password. Type: string.
unlockExcelAction.worksheetNamesOptionalComma-separated worksheet names. Type: string.
unlockExcelAction.worksheetIndexesOptionalComma-separated 1-based worksheet numbers, e.g. `"1,3"`. Type: string.

サンプルペイロード​

秘密のパスワードを入力してロックを解除します​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"unlockExcelAction": {
"password": "{{EXCEL_PASSWORD}}"
}
}

明確な文化でロックを解除する​

{
"document": { "Name": "quarterly-report.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"unlockExcelAction": {
"password": "{{EXCEL_PASSWORD}}",
"cultureName": "en-US"
}
}

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

Headers
Content-Type: application/json + Authorization: Basic <apiKey>.
Body
raw JSON. The password goes INSIDE unlockExcelAction, not at the root. Use a Postman environment variable for it.
Response
JSON with a success flag and Base64 workbook content. Decode the content before saving as .xlsx.
Failures
A wrong password returns success false with an errorMessage; nothing is partially unlocked and the source is untouched.

curlの例​

curl -X POST https://api.pdf4me.com/office/ApiV2Excel/ExcelUnlock \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"document": { "Name": "data.xlsx" },
"docContent": "'"$(base64 -w 0 data.xlsx)"'",
"unlockExcelAction": {
"password": "'"$EXCEL_PASSWORD"'"
}
}' \
--output response.json

何が API 戻る?​

A JSON 結果として保護されていないワークブックが Base64。

分野タイプ内容物
documentString (Base64)The unprotected workbook content. Decode to bytes and save with an .xlsx extension.
fileNameStringOutput filename for the unlocked workbook.
successBooleantrue when unlocking succeeded. Check this before decoding content.
errorMessageStringPopulated when success is false, including the wrong-password case.

コードサンプル​

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

よくある質問​

Can this API unlock an Excel file without the password?+
No. The unlock action removes protection using the correct password you supply in unlockExcelAction.password. It is a workflow tool for files whose password you legitimately hold, not a password cracker or recovery service.
Which kinds of Excel protection does it remove?+
File encryption (the password prompt when opening), workbook structure protection, and worksheet protection are removed in one pass, returning a fully unprotected copy of the workbook.
Is the response the file itself?+
No. The API returns JSON containing the unlocked workbook as a Base64 string plus fileName, success, and errorMessage fields. Decode the content to bytes before saving as .xlsx.
What happens if I send the wrong password?+
The operation fails: success comes back false and errorMessage explains the failure. The workbook is never partially unlocked and your source file is never modified.
Does unlocking change the workbook contents?+
No. Cells, formulas, formatting, and sheets are untouched. Only the protection layers are removed; the output is the same workbook without the locks.
How do I keep the password out of my scripts?+
Inject it at runtime: a Postman environment variable, an environment variable in shell scripts, or a secrets manager in production code. Request bodies frequently end up in logs and version control, so treat the payload as sensitive.
Can I re-protect the file after processing?+
Yes. Chain the Secure Excel action after your processing steps to apply fresh protection to the finished workbook.

なぜロックを解除するのか API 手動で行う代わりに?​

シートレベルロックの手動ルートは シートの保護を解除して Excelファイルを開き、パスワードを入力し、レビュー タブ、シートの保護を解除し、保存し、ファイルごとに繰り返します。これは、保護されたレポートの夜間フォルダには対応できません。 API ファイルごとに1つの決定論的なリクエストと同じパスワード検証済みの削除を実行し、出力は標準のままです オフィス営業中 XML ワークブックはパイプラインの残りの部分で使用できる状態です。

関連アクション​

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

ヘルプが必要な場合​