Skip to content
Last updated

Zendesk Export Integration CLI

You can export data results from TD to Zendesk Sunshine using CLI (TD Toolbelt).

Prerequisites

  • TD Toolbelt is installed.
  • Basic knowledge of Zendesk Sunshine and Zendesk account.

Limitations

The query must match require columns(name & data type) with target event.

Using the Command Line to Create Your Connection

You can use the CLI to configure your connection.

Configuration keys and descriptions as follows:

Config KeyTypeRequiredDescription
typestringyeszendesk
login_urlstringyes unless auth_method is client_credentialsLogin URL for Zendesk
auth_methodstringyesbasic or token or oauth or client_credentials
usernamestringyes if auth_method is basic or tokenYour Zendesk username
passwordstringyes if auth_method is basicZendesk password
tokenstringyes if auth_method is tokenZendesk token
access_tokenstringyes if auth_method is oauthZendesk OAuth access token
subdomainstringyes if auth_method is client_credentialsThe subdomain of your Zendesk URL, for example example for https://example.zendesk.com. Used instead of login_url
client_idstringyes if auth_method is client_credentialsClient ID (unique identifier) of your Zendesk OAuth client
client_secretstringyes if auth_method is client_credentialsClient secret of your Zendesk OAuth client
targetstringyeswhich export Zendesk target: event_profile, event_profile_id or event_user_id
skip_invalid_recordsstringnocontinue when have invalid record
API tokens are being deprecated

Zendesk blocks the creation of new API tokens after 2026-10-27 and deactivates all remaining API tokens on 2027-04-30. Use client_credentials for new scheduled exports. Create the OAuth client in Zendesk Admin Center > Apps and integrations > APIs > OAuth clients, allow the users:write scope, and copy the secret when it is shown — Zendesk displays it only once. Actions are attributed to the Zendesk user who created the OAuth client, so prefer a durable service account. See the Zendesk announcement, Announcing the removal of API tokens as an authentication method for API requests.

Connection and Query Examples

Create an event for profiles

td query --database my_db \
         --result '{
            "type": "zendesk",
            "login_url": "https://{example}.zendesk.com",
            "auth_method": "basic",
            "password": "xxxxx",
            "username": "xxxxx",
            "target": "event_profile",
            "skip_invalid_records": false
         }'
         'SELECT profile_source, profile_type, profile_identifier_1, 
          event_source, event_type, event_properties
          FROM your_table;'

Create an event for profiles using OAuth Client Credentials

td query --database my_db \
         --result '{
            "type": "zendesk",
            "auth_method": "client_credentials",
            "subdomain": "{example}",
            "client_id": "xxxxx",
            "client_secret": "xxxxx",
            "target": "event_profile",
            "skip_invalid_records": false
         }'
         'SELECT profile_source, profile_type, profile_identifier_1,
          event_source, event_type, event_properties
          FROM your_table;'

Create an event for profile id

td query --database my_db \
         --result '{
            "type": "zendesk",
            "login_url": "https://{example}.zendesk.com",
            "auth_method": "basic",
            "password": "xxxxx",
            "username": "xxxxx",
            "target": "event_profile_id",
            "skip_invalid_records": false
         }'
         'SELECT profile_id, event_source, event_type, event_properties
          FROM your_table;'

Create an event for user id

td query --database my_db \
         --result '{
            "type": "zendesk",
            "login_url": "https://{example}.zendesk.com",
            "auth_method": "basic",
            "password": "xxxxx",
            "username": "xxxxx",
            "target": "event_user_id",
            "skip_invalid_records": false
         }'
         'SELECT user_id, profile_source, profile_type, profile_identifier_1, 
          event_source, event_type, event_properties
          FROM your_table;'