API Connection
The API Connection feature in the Scorport Connection Module allows users to integrate external APIs into their strategies, enabling real-time data exchange and enhanced decision-making. This page explains how to configure an API connection, including the use of mock data for testing when real API access is unavailable.
Steps to Add an API Connection
Step 1: Create a New API Connection
- Open the Connection Designer module from your dashboard.
- Click Create New Connection and choose API as the connection type.
- Enter a Connection Name (e.g., "TestConnection") for easy identification.
Step 2: Configure the API
-
Choose the Method:
- Select the HTTP method: GET or POST.
- This determines how the data will be sent or received.
-
Enter the API URL:
- Add the API URL (e.g.,
https://TestAPI/CB) in the URL field.
- Add the API URL (e.g.,
-
Add Query Parameters and Path Parameters:
- Query Params:
- Define the key-value pairs to be appended to the URL as query strings.
- Example:
?key=value.
- Path Params:
- Define the key-value pairs that form part of the URL path.
- Example:
/api/{key}wherekeyis replaced by the value.
- Query Params:
-
Set Up Headers:
- Add headers required for the API, such as
AuthorizationorContent-Type. - Example:
Authorization: Bearer {token}.
- Add headers required for the API, such as
-
Add Payload (For POST Requests):
- Define the JSON body to be sent with the request.
- Example:
-
Create Mock Data:
- If real API access is unavailable, define mock responses for testing:
- Mockup: Provide a simulated response to mimic real API behavior.
- If real API access is unavailable, define mock responses for testing:
Step 3: Test the Connection
- Click the Test button to validate the API connection.
- If using mock data, the system will display the mock response.
- If real API access is available, the system will return the actual API response.
- Debug and refine any configurations as needed.
Step 4: Save the Connection
- After successful testing, click Save to store the connection.
- Pre-define the request parameters (GET or POST) to ensure consistency.
- Note: The URL can only be modified to the real API endpoint after the engine has been fully tested and validated.
Example: API Integration with Mock Data
Scenario: Testing a Credit Score API
- Connection Name:
CreditScoreAPI. - URL:
https://api.creditscore.com/getScore. - Method:
GET. - Query Params:
key:user_id.value:12345.
- Headers:
Authorization:Bearer test_token.Content-Type:application/json.
- Mockup Response:
Best Practices for API Connections
- Use Mock Data:
- When API access is unavailable, mock data allows for testing the strategy workflow without real responses.
- Validate Before Saving:
- Always test the connection to ensure parameters, headers, and payloads are correctly configured.
- Update URLs After Testing:
- Replace the mock URL with the real API endpoint once the engine is ready for production.
Benefits of API Connections
- Real-Time Data:
- Enhance strategies with dynamic, up-to-date information from external sources.
- Mock Testing:
- Ensure strategy accuracy without relying on live API access.
- Seamless Integration:
- Easily incorporate external services into your decision-making workflows.
The API Connection feature in Scorport empowers users to integrate external systems dynamically, ensuring robust and adaptable strategies.

