Skip to main content
Skip table of contents

Connecting to Meltwater via SQL

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

Pre-requisites

  • You need the Access Token for gaining access to the API.

How to Connect

Before you start retrieving data, you need to run the connector script for Meltwater in the CData Virtuality Studio or the Web UI and input your credentials in the following line: 

SQL
CALL SYSADMIN.createConnection (
    name => 'meltwater_src'
    ,jbossCLITemplateName => 'ws'
    ,connectionOrResourceAdapterProperties => 'EndPoint=https://api.meltwater.com/v3,AccessToken=<AccessToken>'
);;
 
CALL SYSADMIN.createDataSource (
    name => 'meltwater_src'
    ,translator => 'meltwater'
    ,modelProperties => 'multitenancy_tablename=<multitenancy_tablename>'
    ,translatorProperties => ''
);;
 
CREATE VIEW meltwater.Credentials
AS
SELECT
        '<label_1>' AS label,
        '<EndPoint_1>' AS EndPoint,
        '<AccessToken_1>' AS AccessToken
UNION ALL
SELECT
        '<label_2>' AS label,
        '<EndPoint_2>' AS EndPoint,
        '<AccessToken_2>' AS AccessToken

You may add additional sets using UNION ALL - just make sure labels are unique.

You may also 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 a label parameter to the procedures of the API, which will identify which credentials should be used in the request. 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.