Connecting to TikTok via SQL
You can use SQL to connect to TikTok in the CData Virtuality Studio or the Code Editor in the Web UI.
Pre-requisites
You need the Client ID and 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 TikTok in the CData Virtuality Studio or the Web UI and input your credentials in the following line:
CALL SYSADMIN.createConnection(
name => 'tiktok_src',
jbossCliTemplateName => 'ws',
connectionOrResourceAdapterProperties => 'EndPoint=https://business-api.tiktok.com/open_api, ClientId=<ClientId>,AccessToken=<AccessToken>'
);;
CALL SYSADMIN.createDatasource(
name => 'tiktok_src',
translator => 'tiktok'
);;
CREATE VIEW tiktok.Credentials
AS
SELECT
'<label_1>' AS label,
'<EndPoint_1>' AS EndPoint,
'<ClientId_1>' AS ClientId,
'<AccessToken_1>' AS AccessToken
UNION ALL
SELECT
'<label_2>' AS label,
'<EndPoint_2>' AS EndPoint,
'<ClientId_2>' AS ClientId,
'<AccessToken_2>' AS AccessToken
You may add additional sets using UNION ALL
- just make sure labels are unique.