...
In Denodo, you can query files in Box by creating connections to individual files. You will need to create one connection and one base view for each file you want to query. To create a connection, you can either execute the VQL in the VQL section in the VQL shell (faster), or follow the steps outlined in Step-by-step.
In either case, the Denodo Box app will need access to the file you want to queryorder to connect a file from Box to Denodo, files must be in the data strategy drop folder. You can accomplish this by either uploading the file to a folder owned by the Denodo Box app (recommended, see Data Strategy Drop Folder) , or by sharing the file with the Denodo Box app. To share a file that is owned by a different service account with the Denodo Box App, in the Share dialog, use the email address provided under Creating a Box App and select Invite as Viewer (example below).
...
Copy and paste this VQL into the VQL shell and replace the following:
Make sure you have the correct database selected in the top left corner of the VQL shell.
{CONNECTION_NAME} with the desired name for the Box file connection
...
{BOX_FILE_ID} with the ID of the file in Box (see step 3 in Step-by-Step).
...
After running the below VQL, navigate to, and double click on the new connection, then click Create Base View.
CSV
Code Block | ||
---|---|---|
| ||
CREATE OR REPLACE FOLDER '/01-base_layer' ; CREATE OR REPLACE FOLDER '/01-base_layer/01-connections' ; CREATE OR REPLACE FOLDER '/01-base_layer/01-connections/Box' ; DROP DATASOURCE DF IF EXISTS {CONNECTION_NAME} CASCADE; CREATE DATASOURCE DF {CONNECTION_NAME} FOLDER = '/01-base_layer/01-connections/box' ROUTE HTTP 'http.CommonsHttpClientConnection,120000' GET 'https://api.box.com/2.0/files/{BOX_FILE_ID}/content' CHECKCERTIFICATES AUTHENTICATION OAUTH20 ( ACCESSTOKEN = 'QdwTWOBaEREKeA5X30NqMRRwjEGY094b5uJp8q/eD38cycmYXTvY43eg8BvtHHm/X8tbbR9GDexgux5dm9STG8VFbDxhgKJMNoEl4jabdPodBkn5vcwrA9kcaDUxgwZh' ENCRYPTED REQUESTSIGNINGMETHOD = HEADER AUTHENTICATION_GRANT = CLIENT_CREDENTIALS_GRANT TOKENENDPOINTURL = 'https://api.box.com/oauth2/token' EXTRA_PARAMETERS_OF_REFRESH_TOKEN_REQUEST ( 'box_subject_type' = 'enterprise', 'box_subject_id' = '192935' ) CLIENTIDENTIFIER = '0jngdws659fyhpkb80f8fbt26q7olovd' CLIENTSECRET = '4fMN87hoo/bjczYeTKGDn+d4kxRCxmjLiy5MQcuYpFlNiT1WMX1BP/m7Ggj5LeUROHpwKOC3872PkcfQLuOK40zjLG5MQ07G7Jro0gK+PG4QpUidG6TmsK86WHylZbf/ZvRGBc0pGr9SzpAccK2MiEsXenWuY5Uju6HPPYRF7IA=' ENCRYPTED ACCESSTOKENEXPIRESIN = 4155 ) PROXY OFF COLUMNDELIMITER = ',' ENDOFLINEDELIMITER = '\n' HEADER = TRUE; |
JSON
Code Block |
---|
# Generated with Denodo Platform 8.0 20230914.
CREATE OR REPLACE FOLDER '/01-base_layer' ;
CREATE OR REPLACE FOLDER '/01-base_layer/01-connections' ;
CREATE OR REPLACE FOLDER '/01-base_layer/01-connections/Box' ;
DROP DATASOURCE JSON IF EXISTS {CONNECTION_NAME} CASCADE;
CREATE DATASOURCE JSON {CONNECTION_NAME}
FOLDER = '/01-base_layer/01-connections/box'
ROUTE HTTP 'http.CommonsHttpClientConnection,120000' GET 'https://api.box.com/2.0/files/{BOX_FILE_ID}/content'
AUTHENTICATION OAUTH20 (
ACCESSTOKEN = 'lJ9DtUEFbvcyXTYkOmnLGRd5LHac+ala0FuWq0d10L8650cm2zzHNWqrBnYmWBo0HEdQL0k8FQ2otLs8Ju6hDl8IdtLn2wvB8YFrgnV2XdyDlhmWYPYIIsQ/BzjSJprpeAYMEw6KP/KaJRJsWvMj6SPH/UmmLioKyxm9vs3oxps=' ENCRYPTED
REQUESTSIGNINGMETHOD = HEADER
AUTHENTICATION_GRANT = CLIENT_CREDENTIALS_GRANT
TOKENENDPOINTURL = 'https://api.box.com/oauth2/token'
EXTRA_PARAMETERS_OF_REFRESH_TOKEN_REQUEST (
'box_subject_type' = 'enterprise',
'box_subject_id' = '192935'
)
CLIENTIDENTIFIER = '0jngdws659fyhpkb80f8fbt26q7olovd'
CLIENTSECRET = 'Lda6Qv/p2BtkG0TXv51kqATg12ZLui50GRk05dwNgasWv1VT75zK6MGdadb59hQQv9ABsq18WEBo+K1Fkl6bk2RMlQAy0G64HF0K/k6OIF5eT0azGD7P9ZGnbWUk25c614W1+5vbaeaVdwcKmIsGZtRetyg6dFnfg+SeysC3Jig=' ENCRYPTED
)
PROXY OFF;
|
Step-by-step
Create a new Data Source file connection (Delimited file, JSON, XML, Excel)
Alternatively, you can use the following VQL:
Select ‘HTTP Client’ as the Data Route
Fill in the Base URL using this format, https://api.box.com/2.0/files/{FILE_ID}/content, replacing {FILE_ID} with the ID of the file in box.
https://developer.box.com/reference/get-files-id-content/Under the Authentication section, fill in the fields as follows. The Token endpoint URL is https://api.box.com/oauth2/token. You’ll need to click on Extra parameters of the refresh token requests and fill in the additional parameters that Box requires (screenshot , as outlined in the linked documentation below
https://developer.box.com/guides/authentication/client-credentials/Fill out the bottom section to match your file configuration. The screenshot below shows a common configuration for a CSV
Test the connection, confirm it works, then click Save.
Click Create Base View to create a base view for the file.
...