Configuring a Connection
After Installing the Connector you can connect and create a Data Source for data in Twitter.
Setting Up a Data Source
Complete the following steps to connect to the data:
- Under Connect | To a Server, click More....
- Select the data source called Twitter by CData.
- Enter the information required for the connection.
- Click Sign In.
- If necessary, select a Database and Schema to discover what tables and views are available.
Using the Connection Builder
The connector makes the most common connection properties available directly in Tableau. However, it can be difficult to use if you need to use more advanced settings or need to troubleshoot connection issues. The connector includes a separate connection builder that allows you to create and test connections outside of Tableau.
There are two ways to access the connection builder:
- On Windows, use a shortcut called Connection Builder in the Start menu, under the CData Tableau Connector for Twitter folder.
- You can also start the connection builder by going to the driver install directory and running the .jar file in the lib directory.
In the connection builder, you can set values for connection properties and click Test Connection to validate that they work. You can also use the Copy to Clipboard button to save the connection string. This connection string can be given to the Connection String option included in the connector connection window in Tableau.
Connecting to Twitter (OAuth)
NOTE: Which version of OAuth you use depends on the table or view you want to access. For the StreamRules table and the TweetStream view, you must use OAuth 2.0 App-Only. For all other tables and views, use OAuth 1.1.OAuth 2.0 App-Only (Bearer Token)
To establish a connection for the StreamRules table or the TweetStream view, you need to authenticate using OAuth 2.0 App-Only authentication.First, generate a bearer token from Twitter's website. The YourBearerToken value is generated from: Twitter's Developer Portal > ProjectOfInterest > Keys and Tokens. For more information, see the Twitter Developers Portal Documentation.
After generating the token and setting the following, you are ready to connect:
- InitiateOAuth: Set this to OFF
- OAuthAccessToken: Set this to YourBearerToken's value.
If you want to access any other tables and views (besides StreamRules and TweetStream), follow the OAuth 1.1 procedures described below.
OAuth 1.1
Desktop Applications
You can connect without setting any connection properties for your user credentials. Or you can create a custom OAuth application. See Creating a Custom OAuth App for more information about custom OAuth applications.The only difference between the two is that you must set additional connection properties if you choose to use a custom application.
After setting the following, you are ready to connect:
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- OAuthClientId (custom applications only): Set this to the consumer key in your app settings.
- OAuthClientSecret (custom applications only): Set this to the consumer secret in your app settings.
- 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. These values persist across connections.
Next Step
See Using the Connector to create data visualizations.