Configuring additional features and settings for API Gateway data service
Reusing output from an earlier transaction
Later transactions can use output from earlier transactions. This behavior is useful when an API returns an identifier, token, status value, or result reference that another API call needs as input.
- Open the later transaction and go to the Input tab.
- Find the input field to map.
- In the Source arrow, select the earlier transaction.
- In the Source field arrow, select the output field to use.
- Click .
Adding a custom output
In most cases, the API metadata includes output fields. In the case it doesn’t you can add output fields manually.
- Open the later transaction and go to the Input tab.
- Click the button.
- Specify the response path in Field path.
- Specify a name in Description.
- Click .
- Repeat for each custom output field.
- Click .
Configuring polling
Use polling when the selected API is asynchronous. Repeat the request until a specific value appears in the response or a field reaches the required state.
Using the Test Transaction
When configuring a transaction, you can use the Test Transactiontab to test the transaction directly in the editor. Testing the transaction in the editor helps you validate the configuration, check required inputs, and identify response fields to include in the output.
Configuring error mapping
Use error mapping to extract meaningful error details from an API response and display them to the user when a transaction fails. Without error mapping, the system shows a generic error message. With error mapping configured, the error dialog can display the specific title, message, and error code returned by the API.
The Error mapping tab is available on API Gateway transactions only.
errors[0].desc: first item in an errors array.error.message: nested field.title: top-level field.
Retrieving data from Data Fabric
To retrieve data from Data Fabric, configure three transactions in one API Gateway data service. Follow the same transaction setup process described earlier, but use the values for Data Fabric.
Submitting the Data Fabric job
This is the an example of the first transaction, submitting the Data Fabric job.
Polling the job status
Add a second transaction.
Retrieving the job result
Add a third transaction.
Use the API gateway data service
When the data service runs, transactions run in their configured order. For a standard data service, each transaction runs once and passes configured outputs to later transactions as needed.
For an asynchronous data service, such as when the service retrieves data from Data Fabric, a polling transaction runs immediately the first time, evaluates the stop condition, and then continues at the configured interval until the condition is met or the timeout is reached.
If the stop condition is satisfied, the last successful response becomes the output used by later transactions. If the timeout is reached, the transaction fails and later transactions do not run.