Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Copy and paste this VQL into the VQL shell and replace {CONNECTION_NAME} with the desired name for the Box file connection and replace {BOX_FILE_ID} with the ID of the file in Box (see step 3 in Step-by-Step).

Code Block
languagesql
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;

...