記入する PDF 形状
PDF4me PDFフォームに記入してください AcroForm フィールドに入力する PDF テンプレートからの値 JSON 単一のオブジェクト REST 呼び出し。テンプレートを次のように送信します。 Base64 または公共 URLフィールド値を文字列として送信します データ配列記入済みの PDF バイナリバイト(200)として、またはロケーションヘッダーポーリングを介して URL (202)切り替え KeepPdfEditable 再編集可能なフォーム、またはフラット化された静的レコードを提供する。
認証 API リクエスト
毎 PDF4me REST 電話にはあなたの API キー Authorization ヘッダーを基本認証として設定します。開発者ダッシュボードからキーを取得またはローテーションしてください。
終点
/api/v2/FillPdfFormhttps://api.pdf4me.com/api/v2/FillPdfForm見逃してはならない重要な事実
データ配列 オブジェクトではなく文字列ですJSON.stringify({...}) 投稿前に。ネストされたオブジェクトを送信すると、逆シリアル化エラーが発生します。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フィールド |
|---|---|---|---|
| A | Base64 PDF | JSON object → stringify → dataArray | All rows in the JSON-form table below. |
| B | Public PDF URL | JSON object → stringify → dataArray | Same as A; templateDocContent is the URL string. |
| C | Base64 PDF | Base64-encoded JSON file → decode → stringify into dataArray | Same as A; build dataArray from the decoded JSON. |
API ボディフィールド
常に送信
| パラメータ | 必須 | その機能 | 例 |
|---|---|---|---|
| jobIdExt | Optional | Your own reference for this call. It is stored with the API call log so you can correlate calls with your jobs. Type: string. | |
| integrations | Optional | Integration identifiers, forwarded unchanged with the job's notification settings. Type: array. | |
| isAsync | Optional | Set 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. |
| templateDocName | Optional | File 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. |
| templateDocContent | Optional | Required. 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. |
| dataArray | Optional | Form 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. |
| outputType | Optional | Not used by this endpoint; the value is ignored. Type: string. | Always "pdf". |
| inputDataType | Optional | Not used by this endpoint; the value is ignored. Type: string. | Always "json" for this path. |
| metaData | Optional | Not used by this endpoint; the value is ignored. Type: string. | |
| metaDataJson | Optional | Not used by this endpoint; the value is ignored. Type: string. | |
| InputFormData | Optional | Form field values as a list of name/value pairs. Takes precedence over `dataArray`. Type: array. | |
| keepPdfEditable | Optional | Keep 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...",
"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",
"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
}
郵便配達員の集荷に関するヒント
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) |
|---|---|---|---|
templateDocName | Required | Required | Required |
templateDocContent | Required (b64) | Required (URL) | Required (b64) |
dataArray | Required | Required | Required (from decoded JSON) |
inputDataType | Required (json) | Required (json) | Required (json) |
outputType | Required (pdf) | Required (pdf) | Required (pdf) |
IsAsync | Required (true) | Required (true) | Required (true) |
KeepPdfEditable | Optional | Optional | Optional |