External API Event
The External API Event feature allows users to configure and manage events that interact with external APIs. This guide covers the setup, validation, triggering, and response validation of external API events.
Overview
External API Events enable users to automate interactions with external APIs by defining the request details, including HTTP method, URL, headers, and query parameters. This feature is useful for integrating with external services and retrieving or sending data as part of automated workflows.
Configuring an External API Event
Configure External API Event
To set up an external API event:
- Title: Enter a descriptive title for the API event.
- Description: Provide a description of the API interaction.
- Method: Specify the HTTP method to use (e.g., GET, POST).
- URL: Enter the URL of the external API endpoint.
- Headers: Set the necessary headers for the API request.
- Query Parameters: Define any query parameters required for the request.
Steps:
- Alice Johnson is setting up an "External API" event.
- Enter the following details:
- Title:
Get User Data
- Description:
Fetch user data from external API
- Method:
GET
- URL:
https://api.example.com/users
- Title:
- Set the headers:
- Key:
Authorization
, Value:Bearer <token>
- Key:
Content-Type
, Value:application/json
- Key:
- Set the query parameters:
- Key:
userId
, Value:12345
- Key:
- Save the configuration.
Outcome: The External API event will be configured with the specified title, description, method, URL, headers, and query parameters.
Validate External API Configuration
To ensure the external API event is configured correctly:
- Action: Review the configured details.
Expected Outcome:
- Alice Johnson should see the configured values for:
- Title
- Description
- Method
- URL
- Headers
- Query Parameters
Trigger External API Event
To activate the external API event based on predefined conditions:
-
Given: The "External API" event is configured and the trigger conditions are met (e.g., user data needs to be fetched).
-
When: The trigger conditions are fulfilled.
Expected Outcome:
- The system should send a request to:
- URL:
https://api.example.com/users
- Method:
GET
- Headers:
- Authorization:
Bearer <token>
- Content-Type:
application/json
- Authorization:
- Query Parameters:
- userId:
12345
- userId:
- URL:
Validate API Response
To verify the response from the external API:
- Action: Check the API response after triggering the event.
Expected Outcome:
- The response should contain the expected user data:
- Response Code:
200
- Response Body:
{ "id": 12345, "name": "John Doe", "email": "john.doe@example.com" }
- Response Code:
Summary
The External API Event Setup feature allows users to automate interactions with external APIs by configuring request details, validating the setup, and handling API responses. This feature is essential for integrating external services into automated workflows and ensuring seamless data retrieval and processing.