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.

DecisionRules

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
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).
What You Can Learn from This Template
By utilizing this template, users can learn to implement the following technical patterns:
  1. Perform GET Requests: The flow demonstrates how to query an external endpoint to retrieve broad datasets, such as a full list of global currencies.
  2. 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.
  3. 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.
Check iconA checkmark inside a circle signifying "yes"Minus iconA minus inside a circle signifying "no"PROS IconA plus symbol representing positive aspects or benefits.CONS IconA minus symbol representing negative aspects or drawbacks.

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.

Explore
financial servicessuggested

Risk Based Pricing

Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.

Explore
financial servicessuggested

Eligibility and Policy Rules

Discover a simple way to define and execute various sets of rules and get the final decision outcome.

Explore