Connecting to Bing

The Sisense Bing connector is a standalone connector that allows you to import data from Bing’s APIs into the ElastiCube. 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 Bing’s API. To obtain a connection string, you will need to create a Bing app.

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

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

Installing the Bing Connector

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

To install the Bing connector:

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

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

Connecting to the Bing REST API

To access Bing’s REST API from Sisense, you must obtain a valid API key. The API Key is provided by Bing after you subscribe to an API.

Obtaining an API Key:

  1. Log in to https://www.bing.com/dev.
  2. From the main menu, select the API you want to retrieve data from.
  3. If you have already subscribed to it, you will see two subscription types, Free Trial and Labs. Select the relevant subscription type.

The API Key is displayed.

  1. Click Copy for the relevant key.
  2. Save the key to paste it into your connection string.

Adding Bing Tables to your ElastiCube

Sisense uses connection strings to connect to Bing and import data into the ElastiCube Managerr.

The connection string to connect to Bing has the following structure:

jdbc:bing:ApiKey=73529b7a4994ytec8d4ca6c33049;InitiateOAuth=GETANDREFRESH;

Mandatory properties are ApiKey, and InitiateOAuth.

Note: To switch between accounts, you need to delete the file OAuthsettings.txt file located at …\Users\xxx\AppData\Roaming\CData\Bing Data Provider.

If you have any issues connecting to your data source, see Troubleshooting JDBC Data Connectors.

To add Bing data:

  1. In the ElastiCube Manager, click Add Data and then, Bing. The Connect to Bing window is displayed.
  2. In Datasource Connection String, enter your connection string.
  3. Click Connect to Server. Bing is displayed in the Select Database list.
  4. Click OK. Sisense connects to Bing and displays a list of tables available for you to import.
  5. Select the relevant tables and click Add. The tables are displayed in the ElastiCube Manager.

Switching between Accounts

When you connect to the Bing data source, Sisense saves your OAuth values in the file OAuthsettings.txt file located at …\Users\xxx\AppData\Roaming\CData\Bing Data Provider on your Sisense server. To connect to the Bing data source with another user on the same machine, you must delete the OAuthsettings.txt file. Sisense will then generate a new file for that user.

Another option to support multiple users is to define the location and file name of an OAuthsettings file for each unique user in your connection string through the OAuthSettingsLocation parameter. When each user connects to the data source, Sisense generates the OAuth file with the file name you specify in the location you define. In the examples below, two users are allowed to access the Bing data source and for each user, Sisense generates a file that contains that user’s OAuth values in the location defined in the string.

jdbc:Bing:OAuthSettingsLocation=C:\Bing\auth\john.txt;OAuthClientId=11276856774486;OAuthClientSecret

=064c70d78567jm2b7e7e4224fad;InitiateOAuth=GETANDREFRESH;Version=2.8;CallbackURL=http://localhost/;

jdbc:Bing:OAuthSettingsLocation=C:\Bing\auth\sally.txt;OAuthClientId=11276856774486;OAuthClientSecret

=064c70d78567jm2b7e7e4224fad;InitiateOAuth=GETANDREFRESH;Version=2.8;CallbackURL=http://localhost/;

In the example above, to OAuth files are created, one for John and one for Sally in the location C:\Bing\auth\.

This is useful if you support many users who each need to access the Bing data source.

Bing Tables

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

Name Description
ImageSearch

Query the Bing image search engine. When querying this table the SearchTerms parameter must be specified. For example, to search Bing Images for the term 'bing' use the following query:

SELECT * FROM ImageSearch where SearchTerms = 'bing'

You can also specify a search safety level:

SELECT * FROM ImageSearch where SearchTerms = 'bing' and SafeSearch = 'Moderate'

NewsSearch

Query the Bing news search engine.

When querying this table the SearchTerms parameter must be specified. For example, to search Bing Images for the term 'bing' use the following query:

SELECT * FROM NewsSearch where SearchTerms = 'bing'

You can also specify a search safety level:

SELECT * FROM NewsSearch where SearchTerms = 'bing' and SafeSearch = 'Moderate'

Search

Query the Bing search engine.

When querying this table the SearchTerms parameter must be specified. For example, to search Bing Images for the term 'bing' use the following query:

SELECT * FROM Search where SearchTerms = 'bing'

You can also specify a search safety level:

SELECT * FROM Search where SearchTerms = 'bing' and SafeSearch = 'Moderate'

VideoSearch

Query the Bing video search engine.

When querying this table the SearchTerms parameter must be specified. For example, to search Bing Images for the term 'bing' use the following query:

SELECT * FROM VideoSearch where SearchTerms = 'bing'

You can also specify a search safety level:

SELECT * FROM VideoSearch where SearchTerms = 'bing' and SafeSearch = 'Moderate'

WebSearch

Query the Bing web search engine.

When querying this table the SearchTerms parameter must be specified. For example, to search Bing Images for the term 'bing' use the following query:

SELECT * FROM WebSearch where SearchTerms = 'bing'

You can also specify a search safety level:

SELECT * FROM WebSearch where SearchTerms = 'bing' and SafeSearch = 'Moderate'

Versions

Version Release Date Improvements
6.6.0.16 March 16, 2017 General release
6.5.1.3 February 8, 2017 General Beta release