Skip to main content
Skip table of contents

Connecting to Snapchat via SQL

You can use SQL to connect to Snapchat in the СData Virtuality Studio or the Code Editor in the Web UI.

Pre-requisites

  • You need the EndPoint, RedirectUri, ClientIdClientSecret and RefreshToken.

How to Connect

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

CODE
CALL SYSADMIN.createConnection (
    name => 'snapchat_src'
    ,jbossCLITemplateName => 'ws'
    ,connectionOrResourceAdapterProperties => 'EndPoint=https://adsapi.snapchat.com,RedirectUri=<RedirectUri>,ClientId=<ClientId>,RefreshToken=<RefreshToken>,ClientSecret=<ClientSecret>'
);;
 
CALL SYSADMIN.createDataSource (
    name => 'snapchat_src'
    ,translator => 'snapchat'
    ,translatorProperties => ''
);;

CREATE VIEW snapchat_src.Credentials
AS
SELECT
        '<label_1>' AS label,
        '<EndPoint_1>' AS EndPoint,
        '<RedirectUri_1>' AS RedirectUri,
        '<ClientId_1>' AS ClientId,
        '<ClientSecret_1>' AS ClientSecret,
        '<RefreshToken_1>' AS RefreshToken
UNION ALL
SELECT
        '<label_2>' AS label,
        '<EndPoint_2>' AS EndPoint,
        '<RedirectUri_2>' AS RedirectUri,
        '<ClientId_2>' AS ClientId,
        '<ClientSecret_2>' AS ClientSecret,
        '<RefreshToken_1>' AS RefreshToken

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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.