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

記入する PDF 形状

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

PDF4me PDFフォームに記入してください AcroForm フィールドに入力する PDF テンプレートからの値 JSON 単一のオブジェクト REST 呼び出し。テンプレートを次のように送信します。 Base64 または公共 URLフィールド値を文字列として送信します データ配列記入済みの PDF バイナリバイト(200)として、またはロケーションヘッダーポーリングを介して URL (202)切り替え KeepPdfEditable 再編集可能なフォーム、またはフラット化された静的レコードを提供する。

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

認証 API リクエスト​

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

終点​

役職/api/v2/FillPdfForm

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

データ配列 オブジェクトではなく文字列です
の API 文字列化されたものを期待します JSONフォームのペイロードは常に JSON.stringify({...}) 投稿前に。ネストされたオブジェクトを送信すると、逆シリアル化エラーが発生します。
キーはAcroFormのフィールド名と完全に一致する必要があります。
フィールド名は大文字と小文字を区別します。Adobe Acrobatでテンプレートを確認してください。 フォームを準備する または、まずExtract Form Dataエンドポイントを呼び出して、入力可能なすべてのフィールドのクリーンなリストを取得してください。
非同期処理は202 + Locationヘッダーを返します
と IsAsync: true の API 202とLocationヘッダーで応答する場合があります。 GET それ URL (同じ認証)が200を返すまで PDF バイナリ。標準 PDF4me 非同期パターン(pdf4meAsyncRequest)

HTTP 設定​

方法: 役職
URL: https://api.pdf4me.com/api/v2/FillPdfForm
コンテンツタイプ: アプリケーション/json
承認: 基本 <あなたの PDF4me API キー>

送信 IsAsync: true 体内で。 200 埋められたものを返す PDF バイナリバイトとして。 202 を返します 位置 アンケート付きのヘッダー URL; GET それ URL 同じ Authorization ヘッダーを使用して、200 を返すまで PDF バイナリ(同じ規則) pdf4meAsyncRequest)

変異マトリックス(ポストマン関連)​

3つの入力バリアントは、すべてのPostman / curl / SDK呼び出しに対応しています。 PDF テンプレートとフォームデータはリアルタイムで更新されます。

変異体PDFテンプレート(テンプレートドキュメントコンテンツ)フォームフィールド必須APIフィールド
ABase64 PDFJSON object → stringify → dataArrayAll rows in the JSON-form table below.
BPublic PDF URLJSON object → stringify → dataArraySame as A; templateDocContent is the URL string.
CBase64 PDFBase64-encoded JSON file → decode → stringify into dataArraySame as A; build dataArray from the decoded JSON.

API ボディフィールド​

常に送信​

パラメータ必須その機能例
jobIdExtOptionalYour own reference for this call. It is stored with the API call log so you can correlate calls with your jobs. Type: string.
integrationsOptionalIntegration identifiers, forwarded unchanged with the job's notification settings. Type: array.
isAsyncOptionalSet to `true` to process the action asynchronously and get a job to poll at `/api/v2/GetActionStatus`. Only honoured by actions that support asynchronous processing. Type: boolean.Default true. Toggles the 200 / 202 + Location async pattern.
templateDocNameOptionalFile name of the PDF form, e.g. `form.pdf`. Defaults to `fillpdfform.pdf`; the extension is always set to `.pdf`. Type: string.Filename of the template, e.g. template.pdf. Derived from the source URL filename or defaulted to template.pdf. Used for downstream output naming.
templateDocContentOptionalRequired. The PDF form to fill. Accepts the base64-encoded file content, a `pdf4meblobid://<id>` reference, or an `https` URL. Type: string.Base64-encoded PDF (no data: prefix) OR a publicly reachable https URL to the PDF.
dataArrayOptionalForm data as a JSON string, e.g. `{"name":"John"}`. Used when `InputFormData` is empty. Type: string.JSON.stringify({ ... }). Keys = AcroForm field names; values = strings to fill.
outputTypeOptionalNot used by this endpoint; the value is ignored. Type: string.Always "pdf".
inputDataTypeOptionalNot used by this endpoint; the value is ignored. Type: string.Always "json" for this path.
metaDataOptionalNot used by this endpoint; the value is ignored. Type: string.
metaDataJsonOptionalNot used by this endpoint; the value is ignored. Type: string.
InputFormDataOptionalForm field values as a list of name/value pairs. Takes precedence over `dataArray`. Type: array.
keepPdfEditableOptionalKeep the form fields editable in the filled PDF. Type: boolean.Default false. Set true to keep AcroForm fields editable in the output PDF; false flattens the form into static text.

*テンプレートドキュメント名 リクエストには必ず設定する必要があります。出力ファイル名が後続の処理でクリーンになるように、適切なファイル名を選択してください。

サンプルペイロード​

バリアントA. PDF Base64 + フォームJSON​

{
"templateDocName": "application-form.pdf",
"templateDocContent": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZw...",
"dataArray": "{\"firstname\": \"John\", \"lastname\": \"Doe\", \"email\": \"[email protected]\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}

データ配列 文字列である必要があります。ネストされた文字列ではありません。 JSON 物体:
"dataArray": "{"firstname":"John","lastname":"Doe"}"

バリアントB. PDF URL + フォームJSON​

{
"templateDocName": "application-form.pdf",
"templateDocContent": "https://example.com/forms/application-form.pdf",
"dataArray": "{\"firstname\": \"John\", \"lastname\": \"Doe\", \"email\": \"[email protected]\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}

バリアントC。PDF Base64 + Base64 JSONからのフォーム​

リポジトリ内のプレースホルダー: eyJmaXJzdG5hbWUiOiJKb2huIn0= → {"firstname":"John"}。

同等 API 体 フォームをデコードした後 JSON:

{
"templateDocName": "application-form.pdf",
"templateDocContent": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZw...",
"dataArray": "{\"firstname\": \"John\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}

オプション。フォームを編集可能にする​

{
"templateDocName": "application-form.pdf",
"templateDocContent": "https://example.com/forms/application-form.pdf",
"dataArray": "{\"firstname\": \"John\", \"lastname\": \"Doe\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": true,
"IsAsync": true
}

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

Headers
Content-Type: application/json + Authorization: Basic <apiKey>.
Body
raw JSON. Copy one of the variant payloads above.
Response
Save as .pdf when status is 200 and the body is binary. If 202, GET the Location URL with the same Authorization until 200.
Field names
Must exactly match AcroForm names in the template. Use the Extract Form Data endpoint or a PDF editor if you are unsure.

curlの例​

curl -X POST https://api.pdf4me.com/api/v2/FillPdfForm \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"templateDocName": "application-form.pdf",
"templateDocContent": "https://example.com/forms/application-form.pdf",
"dataArray": "{\"firstname\":\"John\",\"lastname\":\"Doe\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}' \
--output filled-form.pdf

クイックリファレンス:必須項目とオプション項目(Postman)​

分野A(PDF b64)B(PDFのURL)C(形式b64 → JSON)
templateDocNameRequiredRequiredRequired
templateDocContentRequired (b64)Required (URL)Required (b64)
dataArrayRequiredRequiredRequired (from decoded JSON)
inputDataTypeRequired (json)Required (json)Required (json)
outputTypeRequired (pdf)Required (pdf)Required (pdf)
IsAsyncRequired (true)Required (true)Required (true)
KeepPdfEditableOptionalOptionalOptional

コードサンプル​

よくある質問​

Why must dataArray be a stringified JSON, not a nested object?+
The API contract defines dataArray as a string field. The engine parses the string server-side. Sending a nested object returns a deserialization error. Always wrap your form values with JSON.stringify before posting.
What happens when KeepPdfEditable is true?+
The output PDF retains its AcroForm field definitions so the recipient can re-edit values in any PDF viewer. KeepPdfEditable false (the default) flattens the form into static text, useful for delivering a locked record of what was submitted.
How do I know the exact AcroForm field names?+
Open the template in Adobe Acrobat (Prepare Form), use any PDF editor with field inspection, or call the PDF4me Extract Form Data endpoint first. Keys in your dataArray JSON must match those names exactly, including case.
When should I use Variant B (PDF URL) over Variant A (Base64)?+
Use Variant B when the template is already hosted at a publicly reachable HTTPS URL. It avoids the Base64 size bloat (~33%) and is the simplest path for templates pinned in S3, CDN, or your own static asset host. Use Variant A when the template is private or local.
How does the async flow work?+
Send IsAsync true. If the API returns 200, the PDF binary is in the body. If it returns 202, read the Location response header for a poll URL. GET that URL with the same Authorization header. Continue polling (commonly 10s intervals up to 15 retries) until it returns 200 with the PDF.
Can I send an array of multiple form-data objects?+
No. The REST contract requires a single object inside dataArray (after JSON.stringify). To fill many forms, call the endpoint once per form.
My PDF Base64 has a data: prefix. Do I strip it?+
Yes. The API expects raw Base64 in templateDocContent. Strip any data:application/pdf;base64, prefix before posting.
How do I get back something other than PDF?+
You cannot. outputType is fixed to pdf for this endpoint. To rasterize the filled PDF into PNG / JPEG, chain a downstream PDF4me Convert PDF to Image call.

関連アクション​

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

ヘルプが必要な場合​