{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Postback API","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"postback-api","__idx":0},"children":["Postback API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Dataユーザーは、パブリックREST APIを通じてデータを取り込むことができます。Treasure Dataを使用して、データへのカスタムWebhookを作成できます。この記事では、データインポートREST APIの仕様について説明します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データベース、テーブル、ジョブなどを制御するREST APIについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/td-api"},"children":["REST APIs in Treasure Data"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Data Ingestion APIを使用した改善されたオプションが利用可能です。詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/importing-table-records-using-the-data-ingestion-api"},"children":["Data Ingestion APIを使用したテーブルレコードのインポート"]},"をご覧ください。"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/postback-api#prerequisites"},"children":["前提条件"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/postback-api#endpoint"},"children":["エンドポイント"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/postback-api#limitation"},"children":["制限事項"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/postback-api#post-postbackv3eventdatabasetable"},"children":["POST /postback/v3/event/{database}/{table}"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前提条件","__idx":1},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure Dataの基本的な知識"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"エンドポイント","__idx":2},"children":["エンドポイント"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべてのAPIリクエストは、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["お客様のリージョンに適切なエンドポイント"]},"に送信する必要があります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"制限事項","__idx":3},"children":["制限事項"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Dataは現時点ではアクセスを制限していません。ただし、システムの健全性を確保するために必要と判断された場合、APIへのアクセスを制限する可能性があります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"post-postbackv3eventdatabasetable","__idx":4},"children":["POST /postback/v3/event/{database}/{table}"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"認証","__idx":5},"children":["認証"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべてのリクエストには_認証情報_を含める必要があります。認証は2つの方法で提供できます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["X-TD-Write-Key HTTPヘッダーを指定する。ヘッダー形式は次のとおりです。"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-TD-Write-Key: <APIKEY>"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td_write_key URLパラメータを指定する。例:"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/postback/v3/event/{database}/{table}?td_write_key=<APIKEY>"]}," ","APIキーは、他のすべてのキー/値パラメータと同様にURLエンコードする必要があります。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ヘッダーとURLパラメータの両方が提供されている場合、ヘッダーが優先されます。"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["APIキーはTreasure コンソールから取得できます。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/control-panel/security/#access-control"},"children":["Write Only APIキー"]},"の使用を推奨します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"パラメータ","__idx":6},"children":["パラメータ"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{database}: URLで宛先データベース名を指定します。アルファベット、数字、または _ のみが使用できます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{table}: URLで宛先テーブル名を指定します。アルファベット、数字、または _ のみが使用できます。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"リクエストボディ","__idx":7},"children":["リクエストボディ"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ボディとしてJSONを指定します。JSONコンテンツは、すぐにTreasure Data内のレコードになります。また、HTTPリクエストヘッダーにContent-Type: application/jsonを含めてください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"レスポンス","__idx":8},"children":["レスポンス"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 200 : 成功"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 400 : 不正なリクエスト"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP 403 : 禁止"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"例","__idx":9},"children":["例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["POSTメソッドを介してレコードをインポートするcurlコマンドの例を次に示します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl -D a -X POST \\\n-H 'Content-Type: application/json' \\\n-H 'X-TD-Write-Key: XXXX' \\\n--data-binary '{\"param1\":\"value1\", \"param2\":1234}' \\\nhttps://in.treasuredata.com/postback/v3/event/test_db/test_tbl\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ cat a\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"HTTP/1.1 200 OK\nContent-Type: application/json\nDate: Thu, 03 Dec 2015 02:31:32 GMT\nContent-Length: 2\nConnection: keep-alive\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これにより、次のようにレコードが取り込まれます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"time\": \"1448344701\",\n  \"param1\": \"value1\",\n  \"param2\": 1234\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"Postback API","id":"postback-api","depth":1},{"value":"前提条件","id":"前提条件","depth":2},{"value":"エンドポイント","id":"エンドポイント","depth":2},{"value":"制限事項","id":"制限事項","depth":2},{"value":"POST /postback/v3/event/{database}/{table}","id":"post-postbackv3eventdatabasetable","depth":2},{"value":"認証","id":"認証","depth":2},{"value":"パラメータ","id":"パラメータ","depth":3},{"value":"リクエストボディ","id":"リクエストボディ","depth":3},{"value":"レスポンス","id":"レスポンス","depth":3},{"value":"例","id":"例","depth":3}],"frontmatter":{"seo":{"title":"Postback API"}},"lastModified":"2026-06-01T09:34:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/integration-hub/streaming/postback-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}