Skip to main content

Datasources

Datasources are powerful components that enable you to retrieve and interact with data from external sources such as REST APIs, web services, and third-party applications.

Create a new Datasource

To create a new datasource, follow these steps:

  1. Navigate to Datasources: On the left sidebar menu, locate and click on the "Datasource" label to expand the datasource section.

  2. Create New Datasource: Click on the "Create Datasource" button located in the upper right corner.

image-20230612163527646

  1. Basic Configuration: In the initial setup phase, you'll need to provide:
  • Name: Choose a descriptive name that clearly identifies the purpose of your datasource
  • Description: Add a detailed description explaining what this datasource does and what type of data it provides

image-20230612163527646

  • Endpoint Configuration: After creating the datasource, you'll be automatically redirected to the endpoint configuration tab where you can define your API endpoints.

image-20230612163527646

Supported HTTP Methods

The datasource system supports all standard HTTP methods for comprehensive API interaction:

  • GET: Retrieve data from the server (most common for data fetching)
  • POST: Send data to create new resources
  • PUT: Update existing resources completely
  • DELETE: Remove resources from the server
  • PATCH: Partially update existing resources

Endpoint Configuration

Each endpoint within a datasource can be configured with the following essential information:

  • Name: A unique identifier for the endpoint within the datasource
  • HTTP Method: Select the appropriate HTTP method for the operation
  • URL: The complete endpoint URL or URL pattern

image-20230612163527646

Advanced Configuration Options

Headers Configuration

  • Add custom HTTP headers required by the API

  • Common headers include:

    1. Authorization: For API keys or bearer tokens
    2. Content-Type: Specify the data format (e.g., application/json)
    3. Accept: Define the expected response format
    4. Custom headers specific to your API requirements

Query Parameters

  • Define URL query parameters that will be appended to the request
  • Support for both static and dynamic parameters
  • Examples: ?page=1&limit=10&category=electronics

Path Parameters

  • Configure dynamic segments in the URL path
  • Use placeholders like {id} or {userId} in your URL
  • Example: /api/users/{userId}/orders/{orderId}

Body Parameters

  • Configure request body data for POST, PUT, and PATCH requests
  • Support for JSON, form data, and other content types
  • Can include both static values and dynamic parameters

Managing Datasources

Once you've created a datasource, you can manage it using the available controls: image-20230612163527646

  • Edit Icon (pen): Click to modify the datasource configuration, add new endpoints, or update existing ones
  • Delete Icon (trash bin): Remove the datasource permanently (use with caution)

A single datasource can contain multiple endpoints, which is particularly useful.

Import datasource

The mashup editor supports the import of datasource from an external source.

image-20230612163527646

It's possible to import a file or import the datasource from a URL. Now you can give a name and a description to your datasource.

image-20230612163527646