Skip to main content
Skip table of contents

Connecting to Zendesk via SQL

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

Pre-requsites

  • You need the username, password.

How to Connect

Run the following statements in the CData Virtuality Studio or the Web UI (remember to enter your credentials):

CODE
CALL SYSADMIN.createConnection (
    name => 'zendesk_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 => 'zendesk_src'
    ,translator => 'zendesk'
    ,modelProperties => 'cleanupMethod=DELETE,multitenancy_tablename=<multitenancy_tablename>'
    ,translatorProperties => ''
);;

-- The next statement is optional
CREATE VIEW zendesk.Credentials
AS
        SELECT 
                '<label_1>' AS label, 
                '<EndPoint_1>' AS EndPoint, 
                '<AuthUserName_1>' AS AuthUserName,
                '<AuthPassword_1>' AS AuthPassword,
        UNION ALL
        SELECT 
                '<label_2>' AS label, 
                '<EndPoint_2>' AS EndPoint, 
                '<AuthUserName_2>' AS AuthUserName,
                '<AuthPassword_2>' AS AuthPassword,
        -- You may add additional sets using 'UNION ALL', making sure labels are unique
        ;;

You may optionally add a multi-tenancy table if you wish to access data from multiple accounts in the API.

Keep in mind that you have to manually pass the label parameter to the procedures of the APIto 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, usernamepassword parameters may be omitted. Make sure that they are present in the multi-tenancy table in this case.

Note that you need to specify the full endpoint address in the model properties and the multitenancy table. Unlike many connectors, Zendesk uses the customer name as the second 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, usernamepassword 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.

JavaScript errors detected

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

If this problem persists, please contact our support.