beginnerEasy Start
REST API Client
Flow provides an overview of the REST API Client workflow, designed to demonstrate seamless integration between DecisionRules and external REST services.
David Škarka
Template author
The primary goal of this rule flow is to demonstrate how to use the REST API Client node to communicate with external services. It specifically illustrates how to handle GET and POST requests, including the management of request parameters and the retrieval of HTTP responses.
Solution Components
Solution Components
The workflow is composed of several specialized nodes that sequence the logic for external API interaction:
- HTTP Client Nodes: These act as the primary operators for external communication:
- apiPOSTCountryCurrency: Executes a POST request to retrieve the specific name and currency for a country based on a provided ISO 2-character country code.
- apiGETAllCountriesCurrencies: Executes a GET request to retrieve a comprehensive list of all countries and their respective currencies.
- Node assign: Structures the varied results from the HTTP calls into the final workflow output paths (responseGet and responsePost).
By utilizing this template, users can learn to implement the following technical patterns:
- Perform GET Requests: The flow demonstrates how to query an external endpoint to retrieve broad datasets, such as a full list of global currencies.
- Perform POST Requests with Parameters: The workflow shows how to send a JSON body to an external service. For example, it takes an input variable
{input.country}(e.g., "US" or "SG") and passes it within a POST request body to filter specific API results. - Response Mapping: The template illustrates how to capture the raw HTTP response from external services and map that data back into the DecisionRules environment for further logic or final output.
More Templates
See Other Templates
financial servicessuggested
A/B Testing
Discover a simple way to assign a test group for performing A/B Testing on your decisions.
financial servicessuggested
Risk Based Pricing
Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.
financial servicessuggested
Eligibility and Policy Rules
Discover a simple way to define and execute various sets of rules and get the final decision outcome.