postback-api (1.0.0)

This spec is for Postback-API

POST Postback API

Send data in POST payload. Every request must contain authentication information. Authentication can be provided in two ways:

  1. In header with the X-TD-Write-Key: <APIKEY> format
  2. In URL Path with the ?td_write_key=<APIKEY> format

In case both header and URL parameter are provided, the header takes precedence.

Request
path Parameters
database_name
required
string

Name of the database the table is in. Name may contain letters, numbers or _ .

table_name
required
string

Name of the table to log data to. Name may contain letters, numbers or _ .

header Parameters
X-TD-Write-Key
required
string <uuid>
Example: 12345/abcdef
Request Body schema: application/json

The body of the request can be any key value pairs you want to send. Specify JSON as a body. The JSON content immediately becomes a record in Treasure Data. Also include Content-Type: application/json in HTTP request headers. Suggested Parameters:
td_record_time: UNIX timestamp value, to set time column in Treasure Data. If it's not specified, the time records were received is used instead. Received timestamps that older than 7 days, and newer than 3 days ahead of the current date are ignored.
td_global_id: TODO
td_ua: user-agent
Parameter values are processed as the data type string, and cannot be changed at the ingestion time. That's why it is recommended that you use POST, where you can, to specify records as JSON with types.

string
Responses
200

Success.

400

Bad Request

403

Forbidden

post/postback/v3/event/{database_name}/{table_name}
Request samples
application/json
{
  • "param1": "value1",
  • "param2": "value2"
}
Response samples
application/json
{
  • "Content-Type": "application/json",
  • "Date": "Wed, DD MM YYYY xx:yy:zz GMT",
  • "Strict-Transport-Security": "max-age=31536000",
  • "Content-Length": 2,
  • "Connection": "keep-alive"
}
Support
Copyright © 2021 Treasure Data, Inc. (or its affiliates). All rights reserved.