LINE is in Asia what Facebook Messaging and Instagram are to US mobile users—a fast and easy way to communicate with friends and to discover new promotions about your favorite products and services. LINE is the number one mobile messaging platform in Taiwan. It is also one of the largest mobile messaging platforms in Japan and Thailand. Through Crescendo Labs MAAC API, we are developing an out-of-the-box integration to activate LINE. This integration allows you to authenticate using the API token, upload members with tags, and create and update segments with Line UIDs.
This article contains
Basic Knowledge of Treasure Data.
Basic knowledge of MAAC Crescendo Experience Account
Requirements and Limitations
The Connector implements minimal data validation, you must make sure your data is valid Line/Crescendo Lab spec to avoid job fail. For example, line_uid, email, mobile must be valid Line's data, birthday must be valid ISO format e.g. 1985-04-06.
Use the TD Console to Create Your Connection
Create a New Connection
In Treasure Data, you must create and configure the data connection prior to running your query. As part of the data connection, you provide authentication to access the integration.
1. Open TD Console.
2. Navigate to Integrations Hub > Catalog.
3. Search for and select Line via Crescendo.
4. Select Create Authentication.
5. Type the credentials to authenticate.
6. Type a name for your connection.
7. Select Done.
Define your Query
Depend on the Data Object you've chosen, the supporting columns will be different.
Data Object: Members
|line_uid||string||Yes (if import key is line_uid)||The unique user ID of the member in the LINE official account|
|line_display_name||string||No||The name defined by the member in the official LINE account|
|string||Yes (if import key is email)||Member email address|
|mobile||string||Yes (if import key is mobile)||Member phone number|
|customer_id||string||Yes (if import key is customer_id)||User ID of the third-party system|
|gender||string||No||The gender of the member (default is predicted by MAAC AI)|
|birthday||string||No||Member's birthday (ISO Format) E.g. 2000-02-23|
|tags||comma-separated strings||No||tags to tag to individual members|
Data Object: Segments
|line_uid||string||Yes||Line UID to be imported|
- Complete the instructions in Creating a Destination Integration.
Navigate to Data Workbench > Queries.
Select a query for which you would like to export data.
Run the query to validate the result set.
Select Export Results.
- Select an existing integration authentication.
- Define any additional Export Results details. In your export integration content review the integration parameters.
For example, your Export Results screen might be different, or you might not have additional details to fill out:
Run your query.
Validate that your data moved to the destination you specified.
Integration Parameters for Line via Crescendo Lab
|Access Token (api_token)||String||Yes||Access token|
|Data Object (data_object)||String||Yes||Members (members) or Segments (segments)|
|Import Key (import_key)||String||Yes (if Data Object is Members)|
Value: line_uid, customer_id, email, or mobile
|Tags (tags)||String||Yes||Comma-separated strings of tags|
|Segment Name (segment_name)||String||Yes (if Data Object is Segments)||Segment name|
|Description (segment_description)||String||No||Segment description|
|Skip Invalid Records (skip_invalid_records)||Boolean||No||Skip invalid records and continue the job (default: true)|
|update_segment)||Boolean||No||Update existing segment|
Optionally Schedule the Query Export Jobs
You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.
1. Navigate to Data Workbench > Queries.
2. Create a new query or select an existing query.
3. Next to Schedule, select None.
4. In the drop-down, select one of the following schedule options.
Review Custom cron... details.
|@daily (midnight)||Run once a day at midnight (00:00 am) in the specified time zone.|
|@hourly (:00)||Run every hour at 00 minutes.|
Custom cron... Details
Run once an hour
Run once a day at midnight
Run once a month at midnight on the morning of the first day of the month
Create a job that has no scheduled run time.
The following named entries can be used:
Day of Week: sun, mon, tue, wed, thu, fri, sat
Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec
A single space is required between each field. The values for each field can be composed of:
|Field Value||Example||Example Description|
a single value, within the limits displayed above for each field.
|configures the schedule to run at midnight (00:00) on the first day of each month.|
|a range ||configures the schedule to run at midnight (00:00) on the first 10 days of each month.|
|a list of comma-separated values ||configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.|
|a periodicity indicator ||configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. |
|a comma-separated list of any of the above except the ||configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.|
5. (Optional) If you enabled the Delay execution, you can delay the start time of a query.
Execute the Query
Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically imported to the specified container destination.
Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.
Optionally Configure Export Results in Workflow
Within Treasure Workflow, you can specify the use of a data connector to export data.
Learn more at Using Workflows to Export Data with the TD Toolbelt.