You can write job results from Treasure Data directly to Airship Audience Lists. In Airship, you can then use the List to target specific users.

This topic contains:

Prerequisites

  • Basic Knowledge of Treasure Data.

  • Basic knowledge of Airship / Airship Audience Lists

Creating Your Connection from the Command Line

You can use the CLI to configure your connection. 

td query --database <your_database> --result <configuration> <query>

The following table identifies the configuration keys with descriptions.

Config Key

Type

Required

Description

type

string

yes

airship

base_url

string

yes

access_token

string

-

Airship Bearer access token
Note: access_token or app_key, app_secret is required

app_key

string

-

See App Keys & Secrets

app_secret

string

-

App Secret or Master secret

list_name

string

Yes

Audience List name.

list_description

string

No

Audience List description

skip_invalid_records

boolean

No

Use to skip invalid records and continue uploading a valid one. Set false will terminate the job when invalid records are encountered. The default is true.

For example, a record contains empty or null data.

retry_limit

int

No

Maximum retry times for each API call.

Default: 5

initial_retry_wait_msecs

long

No

Wait time for the first retry.

Default: 60000 milliseconds

max_retry_wait_msecs

long

No

Maximum time between retries.

Default:30000 milliseconds

connection_timeout_secs

long

No

The amount of time before the connection times out when doing API calls.

Default: 300 seconds

write_timeout_secs

long

No

The amount of time waiting for writing data into the request.

Default: 300 seconds

read_timeout_secs

long

No

The amount of time waiting for reading data from the response.

Default: 300 seconds

Example: Query and export results to an Airship Audience List

td query --database my_db \
         --result '{
           "type": "airship",
           "app_key": "xxx"
           "app_secret": "yyy"
           "list_name: amazon_channels,
           "list_description": "amazone collected channels for marketing"
         }'
         'SELECT identifier_type, identifier from my_table'

Scheduling Execution 

Make sure to review:

  • No labels