HTTP/HTTPS Connection Configuration
    • PDF

    HTTP/HTTPS Connection Configuration

    • PDF

    Article summary

    summary

    Help page for creating Data Source HTTP/HTTPS Connection Configuration.
    Use this Connection Configuration when you wish to connect using OAuth 2.0 when retrieving data from HTTP/HTTPS protocol web services.

    In this article, "HTTP/HTTPS protocol web services" will be referred to as data sources.

    HTTP/HTTPS Connection Configuration

    Only required if you want to connect to the data source using OAuth 2.0.
    If OAuth 2.0 is not used, there is no need to create Connection Configuration.

    constraints

    Restriction on connections using OAuth 2.0
    • Only the following grant types are supported.
      • Authorization Code Grant
      • Client Credentials Grant
    • Only Bearer authentication is supported as the authentication method for connecting to the data source when executing an ETL Job.
      • Other authentication methods are not supported.
    • The parameters used to obtain and update tokens and authorization codes are assumed to be compliant with the standard OAuth 2.0 specification.
    • If the access token expires while the ETL Job is running, the ETL Job will fail.
      • In this case, modify the ETL Configuration so that the ETL Job will be completed before the access token expires.
      • The number of records to be retrieved may be reduced in the Filter Setting in ETL Configuration STEP 2.

    advance preparation

    How to obtain OAuth credentials

    Before creating HTTP/HTTPS Connection Configuration, it is necessary to create a client application on the data source side for data acquisition.
    For more information, please refer to the procedure for creating a client application.

    entry

    Client Application Configuration Information

    When using authorization code grants, a redirection endpoint must be configured when creating the client application.
    Please specify the following URL
    https://trocco.io/connections/http/callback

    Connection Configuration

    item nameindispensableContents
    Grant TypeYesSelect a grant type from one of the following
  • authorization code
  • Client Credentials
  • client IDYesEnter the client ID obtained from the authentication settings page of the client application you created.
    client secretYesEnter the client secret obtained from the authentication settings page of the client application you created.
    Authorization URLYes** Enter if an authorization code was selected for the grant type.
    Enter the URL to obtain the authorization code.
    The parameters used in the request are automatically set by TROCCO, but arbitrary parameters can be added.
    See Authorization URL parameters below.
    access token URLYesEnter the URL to obtain the access and refresh tokens.
    The parameters used in the request are automatically set by TROCCO.
    scopeNoYou can enter the scopes to which the access token has access.
    Depending on the Data Source, entering this item may not be necessary if the scope is set in the client application's administration screen.

    Click on Set Details to display the configuration items.

    item nameindispensableContents
    Refresh Token URLNoYou can enter the URL to update the access token and refresh token.
    Enter this item only if the endpoint is differentiated between token acquisition and renewal.
    Authorization URL ParametersNoYou can add any key/ value to the query parameter of the authorization URL.
    Some services require certain parameters to be passed when obtaining authorization codes as a condition for obtaining a token. If so, please enter this item.

    Steps to create a client application

    Before creating Connection Configuration, it is necessary to create a client application on the side of the data source from which data is to be acquired.
    The following is an explanation of the procedure for creating a client application, using HubSpot as an example.
    When creating an app in HubSpot, refer to HubSpot's OAuth Quick Start Guide.

    Procedure for creating a client application

    The procedure for creating a client application depends on the data source you wish to connect to.
    The application creation procedure described below should be considered as a reference.
    When actually creating the application, please refer to the API documentation provided by the data source as appropriate.

    1. Create a developer account.
      001.png

    2. Create an app from the console of your developer account.
      002-p.png

    3. Configure authentication settings for the application to be created.
      003-p.png

      • The redirect endpoint (redirect URL) is https://trocco.io/connections/http/callbackを指定してください.
      • The Scope should be set to the minimum scope required for TROCCO to obtain Data Setting.
      • Record the ID and scope, which are required for Connection Configuration.

    Procedure for Creating Connection Configuration

    1. Open the Create HTTP/HTTPS Connection Configuration screen.
      In the various input fields, enter the IDs and scopes recorded in the client application creation procedure, as well as the endpoint URIs listed in the official API documentation.
      004-p.png

    2. Click Authentication at the bottom of the screen.
      Moves to the authentication screen on the data source side. Follow the on-screen instructions and perform the authentication procedure accordingly.
      If the authentication fails, please check the Connection Configuration and various settings of the client application for errors.
      005-p.png

    3. Confirm successful authentication and click Save.

    How to obtain and renew tokens and authorization codes in TROCCO

    TROCCO will make a request to obtain or update a token based on the value entered in the HTTP/HTTPS Connection Configuration.
    If an authorization code is selected as the grant type, a request to obtain an authorization code is also made.
    Interaction with the data source from which the data is to be retrieved is done on the assumption that the data source conforms to the standard OAuth specification.
    See RFC6749 for the standard specification of OAuth.

    If an authorization code is selected

    Request to obtain authorization code

    The following request is made based on the values entered in the HTTP/HTTPS Connection Configuration.
    If multiple scopes are set, they are specified as single-byte separators.
    Note that if the required parameters or request format are different, acquisition of the authorization code will fail. Please note

    <AUTHORIZATION_ENDPOINT>?response_type=code&client_id=<CLIENT_ID>&redirect_uri=<REDIRECT_ENDPOINT>&scope=<SCOPE1> <SCOPE2> <SCOPE3>&<AUTHORIZATION_URL_PARAMETER_NAME>=<AUTHORIZATION_URL_PARAMETER_VALUE>
    

    Token acquisition request

    The following request is made based on the values entered in the HTTP/HTTPS Connection Configuration.
    The URL is the access token URL, and the following is specified as the data to be POSTed
    If the request format is different, the acquisition of the token will fail. Please note

    {
        grant_type: "authorization_code",
        client_id: <CLIENT_ID>,
        client_secret: <CLIENT_SECRET>,
        code: <AUTHORIZATION_CODE>,
        redirect_uri: <REDIRECT_ENDPOINT>
    }
    

    Token Update Request

    The following request is made based on the values entered in the HTTP/HTTPS Connection Configuration.
    A refresh token URL is specified for the URL, and the following is specified as the data to be POSTed
    If the request format is different, the token update will fail. Please note

    {
        grant_type: "refresh_token",
        client_id: <CLIENT_ID>,
        client_secret: <CLIENT_SECRET>,
        refresh_token: <REFRESH_TOKEN>
    }
    

    If you select Client Credentials

    Token acquisition request

    The following request is made based on the values entered in the HTTP/HTTPS Connection Configuration.
    The URL is the access token URL, and the following is specified as the data to be POSTed
    If the request format is different, the acquisition of the token will fail. Please note

    {
        grant_type: "client_credentials",
        client_id: <CLIENT_ID>,
        client_secret: <CLIENT_SECRET>,
        scope:. <SCOPE1> <SCOPE2> <SCOPE3>
    }
    

    Was this article helpful?