Skip to main content
Skip table of contents

Connecting to Zendesk Talk via SQL

You can use SQL to connect to Zendesk Talk in the CData Virtuality Studio or the Code Editor in the Web UI.

Pre-requisites

  • You need the username, password.

How to Connect

Before you start retrieving data, you need to run the connector script for Zendesk Talk in the CData Virtuality Studio or the Web UI and input your credentials in the following line: 

SQL
CALL SYSADMIN.createConnection (
    name => 'zendesktalk_src'
    ,jbossCLITemplateName => 'ws'
    ,connectionOrResourceAdapterProperties => 'EndPoint=https://ENDPOINT.zendesk.com/api/v2,SecurityType=HTTPBasic,AuthUserName=<Zendesk authentication name>,AuthPassword=<Zendesk authentication password>'
);;
 
CALL SYSADMIN.createDataSource (
    name => 'zendesktalk_src'
    ,translator => 'zendesktalk'
    ,modelProperties => 'cleanupMethod=DELETE,multitenancy_tablename=<multitenancy_tablename>'
    ,translatorProperties => ''
);;

You may optionally add a multi-tenancy table if you wish to access data from multiple accounts in the API. Please, keep in mind, that you have to manually pass a label parameter to the procedures of the API, which will identify, which credentials should be used in the request. If the multi-tenancy table is present, its name should be specified in the model properties, and in this case the endpoint, username, and password parameters may be omitted. Please make sure, they are present in the multi-tenancy table in this case. Please note, that you need to specify the full endpoint address in the model properties and the multitenancy table. Important: unlike many connectors, Zendesk uses the customer name as the 2nd level domain name for the endpoint, so it might be different for the different items of the multitenancy table. 

When you have entered both the endpoint, username, and password parameters in the model properties and the values in the multi-tenancy table, you may specify the label 'default' to direct the engine to use the values from the model properties string. 

If you are not using multi-tenancy, remove the multitenancy_tablename parameter from the model properties, as the default value is not intended to be present in production environments.

SQL
CREATE VIEW zendesktalk.Credentials
AS
        SELECT
                '<label_1>' AS label,
                '<EndPoint_1>' AS EndPoint,
                '<Username_1>' AS Username,
                '<Password_1>' AS Password,
        UNION ALL
        SELECT
                '<label_2>' AS label,
                '<EndPoint_2>' AS EndPoint,
                '<Username_2>' AS Username,
                '<Password_2>' AS Password,
        ;;

You may add additional sets using UNION ALL - just make sure labels are unique.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.