The Sisense Twitter connector is a standalone connector that allows you to import data from Twitter’s API into the ElastiCube Manager. After you have downloaded and installed the connector, you can connect through a connection string you provide Sisense in the ElastiCube Manager. The connection string is used to authenticate users who connect to Twitter’s API. To obtain a connection string, you will need to create a Twitter app.

Once you have connected to Twitter, you can import a variety of tables from the Twitter API.

This page describes how to install the Twitter connector, how to connect to Twitter with a connection string, and what tables you can import into the ElastiCube Manager:

Installing the Twitter Connector

Sisense provides the Twitter connector as a standalone connector that you can download and add to your list of default Sisense connectors.

To install the Twitter connector:

  1. Download the Twitter installation file.
  2. Open the installation file and click Install.
  3. After the installation process is complete, click Close.

The Twitter connector is displayed in the ElastiCube Manager under Add Data > Web Services.

twitter

Accessing Ads Data from Twitter

Before requesting data from Twitter, you must apply for access to your data from Twitter by submitting this request form. As part of your request, you must provide your APP ID. Click here for instructions on how to find your APP ID.

After you have created a Twitter app, you can manage it here. This is useful if you need to set permissions so you can access the relevant data.

Adding Twitter Tables to your ElastiCube

Sisense uses connection strings to connect to Twitter and import data into the ElastiCube Manager. The default connection string for Twitter is: jdbc:twitter:InitiateOAuth=GETANDREFRESH;

After you connect using the default connection string, Sisense redirects you to Twitter’s Login page where you log in and your account is authenticated. Once the account is authenticated, the relevant tables can be added to your ElastiCube.

If you want to customize your connection string, you can by creating a Twitter app and passing additional connection string parameters. For more information, see Creating an App at the end of this page.

To add Twitter data:

  1. In ElastiCube Manager, click Add Data and then, Twitter. The Connect to Twitter window is displayed.
    twitter2
  2. In Datasource Connection String, enter the connection string: jdbc:twitter:InitiateOAuth=GETANDREFRESH;
  3. Click Connect to Server. You are redirected to the Twitter Login page.
  4. Log in with your credentials. Twitter is displayed in the Select Database list in the ElastiCube Manager.
  5. Click OK. Sisense connects to Twitter and displays a list of tables available for you to import.
  6. Select the relevant tables and click Add. The tables are displayed in the ElastiCube Manager.

Twitter Tables

The Sisense Twitter connector allows you to import the following tables into the ElastiCube Manager.

NameDescription
DirectMessagesReceivedQuery and delete direct messages received by the authenticated user.
DirectMessagesSentSend direct messages and query messages sent by the authenticated user.
FavoritesCreate, delete, and query a list of favorite tweets of the authenticated user and allow the user to favorite new tweets or remove existing favorites.
FollowingCreate, delete, and query a list of users that the current Twitter account is following, otherwise known as friends.
TweetsCreate, delete, and query status updates and tweets from the authenticated user.
AccountSettingsQuery account settings about the currently authenticated user.
AdAccountsRetrieve all of the advertising-enabled accounts the authenticating user has access to.
AdAvailableAudiencesQuery available audiences for this account.
AdCampaignsRetrieve details for some or all campaigns associated with the current account.
AdFundingInstrumentsRetrieve some or all funding instruments associated with the account specified in the path.
AdInsightsProvide qualitative information about various Twitter audiences.
AdLineItemsRetrieve some or all funding instruments associated with the account specified in the path.
AdPromotedTweetsRetrieve all of the advertising-enabled tweets the authenticating user has access to.
AdStatsQuery information about all available metrics for a certain entity.
FollowersQuery a list of users following the current Twitter account.
ListMembersQuery the members of a specified list.
ListsQuery Twitter list information based on a set of criteria.
ListSubscribersQuery the subscribers to a specified list.
MentionsQuery a list of retweets of the authenticated user.
RetweetsQuery a list of retweets of the authenticated user.
TrendsQuery the daily trending topics from Twitter.
UsersQuery a list of users based on the SearchTerms, Id, or Screen_Name.

Versions

VersionRelease DateImprovements
6.6.0.49March 20, 2017AdStats table did not return results as expected
6.5.1.33February 8, 2017Ads Marketing table added

Creating an App

To access Twitter’s REST API from Sisense, you must provide valid Oauth Twitter credentials. These credentials are provided by Twitter when you create an application. Each connection string contains a authentication parameters that the data source uses to verify your identity and what information you can export to Sisense. To learn more, see Connection String Parameters.

The Twitter connection string looks like this:

jdbc:twitter:OAuthClientId=xxxxxxxxxxxxx;OAuthClientSecret=xxxxxxxxxxxxxxxxx;InitiateOAuth=GETANDREFRESH;CallbackURL=http://localhost/;Timeout=0;

The following parameters are mandatory when connecting with a customized connection string:

  • OAuthClientId: Set this to the consumer key in your app settings.
  • OAuthClientSecret: Set this to the consumer secret in your app settings.
  • CallbackURL: Set this to the callback URL you specified in your app settings.
  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken and OAuthAccessTokenSecret.

You can follow the steps below to obtain the OAuth client credentials:

  1. Log in to https://dev.twitter.com/apps.
  2. Click Create New App.
  3. Enter the name, description, and website to be displayed to users when they connect.
  4. Define the callback URL setting.If you are making a Web app, set the callback URL to the URL you would like users to be returned to after they have granted your application privileges.If you are making a desktop application, set the callback URL to http://localhost/.

Once you have created the app, you will be redirected to a page with information about your app.

If you intend to communicate with Twitter only as the currently authenticated user, then you can obtain the OAuthAccessToken and OAuthAccessTokenSecret directly from this page on Twitter. The OAuthAccessToken and OAuthAccessTokenSecret are listed under the OAuth Settings in the Your Access Token section. You can then connect by setting these connection string properties and do not need to continue to the other steps.

Otherwise, if you need to generate access tokens for other user accounts besides the one you used to create the app on Twitter, use the consumer key and consumer secret in the following steps.