Skip to content
Last updated

Zendesk Export Integration

Zendesk® Sunshine's modern cloud based CRM platform is used to identify customer needs and trends. You can use the Zendesk Export Integration connector to export Events data to Zendesk Sunshine.

Prerequisites

  • Basic knowledge of Treasure Data
  • Zendesk Sunshine account

Limitations

The result output schema must match the required columns (name and data type) with a target event.

profile_identifier can be set to a maximum of 20 columns (1 → 20 in a continuously ascending order).

ActionTargetColumn requiredColumn requires at least 1Column optionalNote
CreateEvents for profilesprofile_source(String), profile_type(String), event_source(String), event_type(String), event_properties(JSON String)profile_identifier_1 to profile_identifier_20 (String)profile_name, profile_created_at, profile_attributes, event_description, event_created_at, event_received_atSee "Identifier columns" below for format and limits.
CreateEvents for a profile IDprofile_id(String), event_source(String), event_type(String), event_properties(JSON String)event_description, event_created_at, event_received_atSee "Events for a profile ID" details.
CreateEvents for a user IDuser_id(String), profile_source(String), profile_type(String), event_source(String), event_type(String), event_properties(JSON String)profile_identifier_1 to profile_identifier_20 (String)profile_name, profile_created_at, profile_attributes, event_description, event_created_at, event_received_atSee "Identifier columns" below for format and limits.

Column details

Events for profiles

Required columns

  • profile_source (String)
  • profile_type (String)
  • event_source (String)
  • event_type (String)
  • event_properties (JSON String) – provide serialized key-value pairs for the event payload.

Identifiers (at least one)

  • Up to 20 columns named profile_identifier_1 through profile_identifier_20.
  • Each value must follow the type,value pattern (for example, email,example@gmail.com).

Optional columns

  • profile_name
  • profile_created_at
  • profile_attributes
  • event_description
  • event_created_at
  • event_received_at

Events for a profile ID

Required columns

  • profile_id (String)
  • event_source (String)
  • event_type (String)
  • event_properties (JSON String)

Optional columns

  • event_description
  • event_created_at
  • event_received_at

Events for a user ID

Required columns

  • user_id (String)
  • profile_source (String)
  • profile_type (String)
  • event_source (String)
  • event_type (String)
  • event_properties (JSON String)

Identifiers (at least one)

  • Same profile_identifier_1 through profile_identifier_20 columns and type,value rule as listed above.

Optional columns

  • profile_name
  • profile_created_at
  • profile_attributes
  • event_description
  • event_created_at
  • event_received_at

Zendesk Sunshine Limitations

Rate Limit

The API enforces rate limiting on standard create endpoints. Limits include requests made from the Zendesk Apps framework. The rate limits for each plan type are:

Sunshine LiteSunshine ProfessionalSunshine Enterprise
Custom objects500 requests per minute750 requests per minute1,000 requests per minute
ProfilesNot included250 requests per minute500 requests per minute
EventsNot included250 requests per minute500 requests per minute

Profiles Limit

The following table shows profiles hard limits. Availability and limits can vary according to Sunshine plan type.

CategoryLimit
Profiles30,000,000
Profile sources50
Profile types2500
Identifiers per profile20
Profile source character length40
Profile type character length40
Identifier source character length60
Identifier type character length60

Event Limit

The following table shows events hard limits. Availability and limits can vary according to Sunshine plan type.

CategoryLimit
Event sources50
Event types2500
Event source character length40
Event type character length40

Use the TD Console to Create Your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection to be used during export prior to running your query. As part of the data connection, you provide authentication to access the integration.

  1. Open the TD Console.

  2. Navigate to Integrations Hub > Catalog.

  3. Search and select Zendesk.

  1. Click Create. You are creating an authenticated connection. The following dialog opens.

  1. To export event data, type the login URL for Zendesk. For example: https://{your_domain}.zendesk.com.

  2. There are different options for Auth method: basic, token, and OAuth.

  3. Optionally, for basic authentication, type values for username and password.

  4. Optionally, for token, type values for username and token.

  5. Optionally, for OAuth, type values for OAuth Access Token.

  6. Select Continue.

  7. Name your new Zendesk connection.

  8. Select Done.

Configure Export Results in Your Data Connection

Create or reuse a query.

Sometimes you need to define the column mapping in the query.

  1. Open the TD Console.

  2. Navigate to Data Workbench > Queries.

  3. Select the query that you plan to use to export data. Each type of resource requires specific columns and exact column names (case sensitive) and data types. Code examples that can be used to export data:

Events for profiles

SELECT 
 profile_source, 
 profile_type, 
 profile_identifier_1,
 event_source, 
 event_type, 
 event_properties
FROM 
  your_table;

Events for profile ID

SELECT p
 profile_id, 
 event_source, 
 event_type, 
 event_properties
FROM 
 your_table;

Events for user id

SELECT 
 user_id, 
 profile_source, 
 profile_type, 
 profile_identifier_1,
 event_source, 
 event_type, 
 event_properties
FROM 
 your_table;
  1. Select Export Results located at the top of your query editor.  The Choose Integration dialog opens. You have two options when selecting a connection to export the results, using an existing connection or creating a new one. These instructions assume you are selecting an existing connection.

  2. Type the connection name in the search box to filter.

  3. Select your connection.

  4. Select one of the following:

  1. Optionally, select Skip invalid records.

  2. Select Done.

(Optional) Schedule Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.

Treasure Data's scheduler feature supports periodic query execution to achieve high availability.

When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.

For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.

Scheduling your Job Using TD Console

  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:

    Drop-down ValueDescription
    Custom cron...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.
    NoneNo schedule.

Custom cron... Details

Cron ValueDescription
0 * * * *Run once an hour.
0 0 * * *Run once a day at midnight.
0 0 1 * *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.
 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

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 ValueExampleExample Description
A single value, within the limits displayed above for each field.
A wildcard '*' to indicate no restriction based on the field.'0 0 1 * *'Configures the schedule to run at midnight (00:00) on the first day of each month.
A range '2-5', indicating the range of accepted values for the field.'0 0 1-10 * *'Configures the schedule to run at midnight (00:00) on the first 10 days of each month.
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field.0 0 1,11,21 * *'Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run.'30 */2 1 * *'Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'.'0 0 5,*/10,25 * *'Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
  1. (Optional) You can delay the start time of a query by enabling the Delay execution.

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 exported to the specified destination.

Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.

(Optional) You can delay the start time of a query by enabling the Delay execution.

Activate a Segment in Audience Studio

You can also send segment data to the target platform by creating an activation in the Audience Studio.

  1. Navigate to Audience Studio.
  2. Select a parent segment.
  3. Open the target segment, right-mouse click, and then select Create Activation.
  4. In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
  5. Customize the activation output in the Output Mapping panel.

  • Attribute Columns
    • Select Export All Columns to export all columns without making any changes.
    • Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
  • String Builder
    • + Add string to create strings for export. Select from the following values:
      • String: Choose any value; use text to create a custom value.
      • Timestamp: The date and time of the export.
      • Segment Id: The segment ID number.
      • Segment Name: The segment name.
      • Audience Id: The parent segment number.
  1. Set a Schedule.

  • Select the values to define your schedule and optionally include email notifications.
  1. Select Create.

If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.

Optionally Configure Export Results in Workflow

See About Using Workflows to Export Data with the TD Toolbelt for more information on using data connectors in a workflow to export data.

Examples of Exporting Events for Profiles

Using Basic Auth:

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: basic
    username: {username}
    password: {password}
    target: event_profile
    skip_invalid_records: true

Using Auth Token:

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: token
    username: {username}
    token: {token}
    target: event_profile
    skip_invalid_records: true

Using OAuth Token

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: oauth
    access_token: {access_token}
    target: event_profile
    skip_invalid_records: true

Examples of Exporting Events for Profile ID

Using Basic Auth

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: basic
    username: {username}
    password: {password}
    target: event_profile_id
    skip_invalid_records: true

Using Basic Auth

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: basic
    username: {username}
    password: {password}
    target: event_user_id
    skip_invalid_records: true