Getting Started

To get started you can either follow along with our quickstart tutorial or you can jump directly into the API reference material.

About REST APIs

Representational State Transfer (REST) defines a set of architectural principles by which you can design Web services that focus on systems’ resources and how these resource states are addressed and transferred over HTTP by client applications written in different languages. REST requires that a client make a request to the server to retrieve or modify data on the server. A request generally consists of:

  • an HTTP verb, which defines what kind of operation to perform
  • a header, which allows the client to pass along information about the request
  • a path to a resource
  • an optional message body containing data

The basic HTTP verbs to interact with resources in a REST system are

  • GET — retrieve a specific resource (by id) or a collection of resources
  • POST — create a new resource
  • PUT/PATCH — update a specific resource (by id)
  • DELETE — remove a specific resource by id
Operation HTTP REST SQL Equivalent
Create a resource on the server POST INSERT
Retrieve a resource GET SELECT
Update or change a resource state PUT/PATCH UPDATE
Remove or delete a resource DELETE DELETE

Choosing Your Data Import Method

There are various ways to bring your data into Treasure Data. Depending on the format of your data, or the languages you are using, you might consider several options.

If no solution is found in the client libraries, you might need to write a client for one of the following APIs that corresponds to the programming language or data format you are using.

There are several Public Import APIs available in each region. The API you use will depend on your data format and the sites and endpoints for your region.

Determine Your Import API Method

  1. Select your data format from one of the following.

    • msgpack — You can use the Treasure Data Import API if you have batches of data in gzipped msgpack format or you are using fluentd . This API is also known as the "Stream Import" API, and uses api-import subdomain.

      Most client libraries—as well as td-agent, td toolbelt, and fluentd collector daemon—use this API.

    • JSON — You can use the Postback API if you have small batches of JSON format data. This API is also known as the "JS/ Mobile SDK/ Postback" API and uses the in subdomain. It expects frequent, small payloads. The JavaScript , Android , and iOS SDKs use this API.

    • Other External Systems or Formats — If your data is held by a third party, accessed by API or via file export, you can use the Treasure Data Bulk Import API . This API combines the api subdomain and v3/bulk_import/* paths. Treasure Data’s embulk-based integrations use this API. Learn more about Treasure Data’s powerful integrations .

  2. Choose the appropriate baseURL from a list of Sites and Endpoints .