K3 Documents

HTTP Source Adaptor

Updated on

HTTP (Hypertext Transfer Protocol) is a client-server protocol used to fetch resources such as HTML documents, JSON, XML, CSV files, etc.


Outlined below are the steps to configure the K3 HTTP Source Adaptor to receive data through an HTTP call.  

Configure Execution

1. Select the HTTP adaptor that corresponds to the data type that will be received

In this example, JSON over HTTP was selected as the Source, and Deadend as the Target. Once both the Source and the Target are selected, a new screen will appear.

2. Name the route

On the new screen, click on Route Name and begin typing the new Route's name. In this example, the route was named "Sales Data REST".

3. Click Configure Route

The HTTP parameters must be established before the route can be created. Click Configure Request, located below the name of the route and the summary of the Source and Target, to open the configuration window. 

4. Choose the authentication method

Authentication Method Description
None No authentication is required
Basic Auth Standard HTTP authentication
OAuth OAuth is an authentication protocol that allows a user to approve one application interacting with another on the users behalf without giving out a password. 
Custom The user provides a custom authentication request

5. Click Payload Request

Located above OAuth, click Payload Request to construct the HTTP request. 

Parameter Description
Query Params Add key value pairs to be send as query parameters in the HTTP request.
Headers Add HTTP header key value pairs to be send in the HTTP request.
Body Add form parameters as part of the HTTP request when using the POST or PUT method.
Basic Auth If you are using Basic Auth, you can provide the Username and Password in this section.
Curl Adding a cURL command here will fill in all of the HTTP parameters based on the command parameters provided. This can be used to bootstrap the adaptor from a working cUrl command.
Response Server response from executing a command. Used to test your request and finalize the adaptor setup. This will only be present if you have executed a request.

Configure Update Parameter

1. Click Response, then click Execute

Once all the parameters are entered, click Response. The initial window will be blank. Click Execute to submit the request. A sample of the data received will be displayed on the lower left half of the Response window. 

2. Select the update parameter

K3 will run the given HTTP request on regular intervals, but in order to keep accurate records, a parameter must be chosen so that each subsequent call does not retrieve old data. 

1. On the left-hand screen, toggle the Query Params  button on.

2. Click the Pencil next to the toggle switch to enable editing.

3. Each key-value pair in the sample data on the right hand side will be boxed. Click the value that will  be used to update each HTTP call for all subsequent calls. In this example, "Modified Date" was selected. K3 will now use the Modified Date from the call to get all data created or modified after the previous call to ensure there is no duplicate data being entered into K3. 

4. Click OK in the lower right hand corner. This will save the update parameter and exit the Payload Request window.

Parsing JSON Response

1. Click Add Sample Data, then click Add Data From HTTP Response

After opening the Sample Data window, click Add Data From HTTP Response. K3 will automatically import the data received from the HTTP call, list all paths on the right half of the window, and suggest which path to parse by highlighting the corresponding Configure JSONPaths in green. 

In the below example, K3 determined that the path that needs to  be parsed is the results path, and highlighted the corresponding Configure JSONPaths button.

2. Click Configure JSONPaths

Click the Configure JSONPaths  button corresponding to the path that needs to be parsed. This will open the Configure JSONPaths window. 

From the left hand window, click the data that will flow through K3. Each selected value will appear on the right hand side next to the assumed field type. If K3 misinterpreted the field type, click the field type to open a drop down menu and select the correct field type.

Once all the data has been selected, and the field types are correct, click Ok on the bottom right of the window to be brought back to the summary page.

3. Review Date formats

K3 will determine the date/date time formats from the sample data. If any other formats are present in the data, but not included in the summary page, click +Add under the respective Date/Date Time format fields to add the missing format.

4. Configure Target Adaptor

Once the HTTP Source adaptor is configured, the Target adaptor must be configured as well. Please see the respective guide for assistance in configuring the Target adaptor.

5.  Click Create

Click Create to create the Route. A pop-up window will will display the fields previously selected. Click Save if everything is correct.

Previous Article SQL Server Target Adaptor
Next Article CSV over FTP Adaptor