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:
Navigate to Datasources: On the left sidebar menu, locate and click on the "Datasource" label to expand the datasource section.
Create New Datasource: Click on the "Create Datasource" button located in the upper right corner.
- 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
- Endpoint Configuration: After creating the datasource, you'll be automatically redirected to the endpoint configuration tab where you can define your API endpoints.
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
Advanced Configuration Options
Headers Configuration
Add custom HTTP headers required by the API
Common headers include:
- Authorization: For API keys or bearer tokens
- Content-Type: Specify the data format (e.g., application/json)
- Accept: Define the expected response format
- 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:
- 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.
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.