This article is meant to get users started on the Basic Authentication connector in Qlik Application Automation.
The connector is designed for advanced users to connect to platforms that do not have a dedicated connector.
The connector employs the Basic authentication flow, which requires only the username and password to make requests to a specific API.
Index:
Limitations
- This connector will work with the majority of Basic Authentication flows. In cases where there are additional fields to be sent such as additional query parameters in the authorize request, this connector will not work.
How to connect
Begin by looking for the "Basic Authentication" connector. When you click connect, the following input parameters are requested:
- Connector name: A name for the connection. This can be used as an identifier for the user in the editor to differentiate between different API key connections.
- Username: Enter the API username to use for authentication.
- Password: Enter the API users password to use for authentication.
- Base URL: This should be the beginning of the URL to which you will be making REST calls. We recommend including this because it prevents calls to other URLs (omit the https://).
How to use in an automation
Once you select the connector you will notice that there are only a few blocks available, depending on the type of request and pagination involved in your request. These blocks have the following input variables:
- RAW API REQUEST BLOCK
- Path: This needs to be relative to the Base URL you provided when connecting.
- Method: Enum choice between GET, POST, DELETE, PATCH or PUT.
- Query Parameters: Here you can provide a JSON object and the key/values will be added to the path as query parameters.
- Request Body: A JSON object can be provided for POST, PATCH or PUT operations that will be sent as a request body.
- Headers: JSON object and these keys/values will be added as headers to the request.
- RAW API LIST REQUEST BLOCK(s)
- Method: Enum choice between GET, and POST in case of the block with No Paging Support is selected. The rest of the List Request blocks use the GET method by default.
- Json Path for Output Records: This field is used to parse a section of the JSON returned by the API endpoint. This only returns a parsed VALUE.
- Other Input Parameters: Other input parameters in the blocks are determined by the type of paging supported by the block. You can find more information about those under the input text boxes.
- Json Path for Cursor : This field is used to indicate the location of "next page URL" or the "token" for the next page in the response.
An Example
The following example will obtain a list of contacts from the DotDigital application. We do not yet have a connector to do this and Basic Authorization is used to obtain the value for the Authorization header. We start by obtaining the Base URL and username and password from the DotDigital documentation. We can find these at https://developer.dotdigital.com/ . We then use the following values:
- Connector Name : DotDigital
- Username : ***************
- Password : ****************
- Base URL : r1-api.dotdigital.com/v2/
Once you input the above details in the connector connection pop-up and click save, it will say the connector is connected. But since this is a generic connector, we don't have a way of verifying if the connector is actually connected. This will be evident when you run an endpoint.
Using it in an automation
Create a new automation and drag the Raw API List Request Offset-Based Paging block from the Basic Authentication connector onto the canvas. Since the DotDigital connector supports offset-based paging, we will be using the Offset-Based Paging block to execute the list contacts api.
Raw API List Request Offset-Based Paging block inputs are as follows:
- Path : contacts (we have already provided "r1-api.dotdigital.com/v2/" during connection, "https://" is added by default)
- Query Parameters: {"withFullData": "true"}
- Headers: No extra headers required, "Accept: application/json" is sent by default.
- Page Size Field Name: select
- Page Size: 100
- Offset Field Name: skip
- Offset Start: 0
These last four parameters enable the offset-based paging. You can read more about this here.
- Json Path For Output Records: No json path is required for this list, as the contact API results are not inside any array.
Now when you execute this, it will return the list of contacts in DotDigital.
The information in this article is provided as-is and is to be used at your own discretion. Depending on the tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.