Connecting to Zendesk
To authenticate to Zendesk, you can use either Basic authentication or the OAuth standard. Use Basic to connect to your own data. Use OAuth to allow other users to connect to their data.
Using Basic AuthenticationTo use Basic authentication, specify your email address and password or your email address and an API token. Set User to your email address and follow the steps below to provide the Password or ApiToken.
- Enable password access in the Zendesk Support admin interface at Admin > Channels > API.
- Manage API tokens in the Zendesk Support Admin interface at Admin > Channels > API. More than one token can be active at the same time. Deleting a token deactivates it permanently.
Using OAuth AuthenticationOAuth requires the authenticating user to interact with Zendesk using the browser. The driver facilitates this in various ways as described below.
Register an OAuth Application
Follow the procedure below to register a third-party application and obtain the OAuth client credentials, the OAuthClientId and OAuthClientSecret. Note that this procedure requires admin access to your Zendesk account.
- In the Zendesk Support Admin interface, go to Admin > Channels > API.
- Click the OAuth Clients tab on the Channels/API page and then click the plus icon (+) on the right side of the client list.
Complete the required fields to create a client.
If you are making a desktop application, set the Redirect URI to http://localhost:33333 or a different port number of your choice.
If you are making a Web application, set the Redirect URI to a page on your Web app you would like the user to be returned to after they have authorized your application.
- Click Save. After the page refreshes, a new prepopulated Secret field appears on the lower side.
- Use the unique identifier as the OAuthClientId and the secret value as the OAuthClientSecret.
Authenticate to Zendesk from a Desktop Application
After setting the following connection properties, you are ready to connect:
- OAuthClientId: Set this to the client Id that you specified in your app settings.
- OAuthClientSecret: Set this to the client secret that you specified in your app settings.
- CallbackURL: Set this to the Redirect URI you specified in your app settings.
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to manage the process to obtain the OAuthAccessToken.
- Extracts the access token from the callback URL and authenticates requests.
- Obtains a new access token when the old one expires.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
Authenticate to Zendesk from a Web Application
When connecting via a Web application, follow the steps below to get and manage the OAuth token values using the driver.
Get an Access Token
Set the following connection properties to obtain the OAuthAccessToken:
- OAuthClientId: Set this to the Client Id in your app settings.
- OAuthClientSecret: Set this to the Client Secret in your app settings.
You can then call stored procedures to complete the OAuth exchange:
- Call the GetOAuthAuthorizationURL stored procedure. Set the AuthMode input to WEB and set the CallbackURL input to the Redirect URI you specified in your app settings. The stored procedure returns the URL to the OAuth endpoint.
- Log in and authorize the application. You are redirected back to the callback URL.
- Call the GetOAuthAccessToken stored procedure. Set the AuthMode input to WEB. Set the Verifier input to the "code" parameter in the query string of the callback URL.
Connect to Data
To authenticate your requests for data, set the following: