Data Source Configuration
Data Source Configuration Guide
Section titled “Data Source Configuration Guide”Overview
Section titled “Overview”The API Configuration System allows users to define and execute API requests dynamically. It supports path parameters, query parameters, and configurable inputs for flexible API interaction. This document outlines the structure, features, and usage of the system.
Configuration Structure
Section titled “Configuration Structure”Each API request is defined using a JSON configuration file. Below is an example of a typical configuration: beceause
{ "url": "https://dummyjson.com/products/{{num}}", "type": "GET", "inputs": [ { "name": "num", "type": "url", "label": "Product number", "description": "The number of the product to fetch", "isRequired": true, "isHidden": false, "isConfigurable": false }, { "name": "test", "type": "get", "label": "Test", "description": "A test option", "isRequired": true, "isHidden": true, "isConfigurable": true } ], "output": { "paths": [ { "name": "price", "path": "$.price" } ] }, "useProxy": false, "compatibleWith": [ "value", "multivalue" ] } }
Key Components
Section titled “Key Components”1. URL
Section titled “1. URL”"url": "https://dummyjson.com/products/{{num}}"
The API request’s base URL, supporting path parameters wrapped in {{ }}.
2. Type
Section titled “2. Type”"type": "GET" | "POST" | "POST_FORM"
Defines the HTTP method used for the request, supporting: GET, POST & POST_FORM
3. Inputs
Section titled “3. Inputs”"inputs": [{},{}]
Each input defines a parameter that can be part of the request. Inputs can be of different types:
Path Parameters (type: "url")
Section titled “Path Parameters (type: "url")”Path Parameters are dynamic placeholders inside the URL path. They allow API requests to be flexible and retrieve specific resources based on the provided values.
{ "name": "num", "type": "url", "label": "Product number", "description": "The number of the product to fetch", }
Example Usage
Section titled “Example Usage”If an API needs to fetch product details by product ID, the URL might be structured as follows:
"url": "https://dummyjson.com/products/{{num}}"
Here, {{num}} is a path parameter that must be replaced with a valid value.
Example Request
Section titled “Example Request”When calling the API with a specific product number, such as 5, the final request would be:
GET https://dummyjson.com/products/5
This would return data specific to the product with ID 5.
Query Parameters (type: "get")
Section titled “Query Parameters (type: "get")”- Appended to the URL as key-value pairs (
?key=value). - Example:
{ "name": "test", "type": "get", "label": "Test", "description": "A test option", "isRequired": true, "isHidden": true, "isConfigurable": true }
Other properties
Section titled “Other properties”nameThe unique identifier for the input.typeDefines whether the input is a path parameter (url) or query parameter (get).labelA human-readable name for the input.descriptionA brief explanation of the input’s purpose.isRequiredSpecifies if the parameter is mandatory (true) or optional (false).isHiddenDetermines whether the input is visible to the user.isConfigurableDefines if the user can modify the input value....more to be added