Creating an API Mashup
Before you begin
- The API must include the resource and the method in which you want to add the API mashup.
- The participating APIs (that you want to include in the mashup) must exist in the API Gateway instance.
About this task
To create a mashup in a REST API
Procedure
-
Click
APIs in the title navigation bar.
A list of all registered APIs appears.
-
Click the required API.
The API details page appears.
- Click Edit.
-
Click
Mashups.
The Mashups tab appears. It displays the resources in the API and their methods on the left and an empty (Default routing) routing diagram.Note: If the API does not have any mashup, the Mashup tab displays the list of resources only in the Edit mode; the tab is empty in the view mode.
-
In the
List of resources, click the resource in
which you want to include the mashup.
The resource tab expands and the methods included in the resource are displayed.
-
Click the toggle button to enable the method in which you want
to create the mashup.
Note: If you use the toggle button and disable a method that has a mashup, the mashup definition for that method is immediately cleared.
-
Click
Add invoke to add a mashup step.
-
Connect the step to
Start.
The Start and Stop terminators and all steps have connection points that you can connect to the other steps and terminators. p
To select a connection point and connect it to another connection point:
- Hover the mouse over the top or bottom of the step or terminator till the connection point is highlighted.
- Click the connection point and drag to the other step or terminator.
-
Configure the step properties as desired.
The Mashup Routing panel that appears on the right side of the mashup canvas displays the properties for the selected step. You can configure the following properties using the Mashup Routing panel:
Section Field Description Mashup step name Provide a name for the mashup step that is unique within the mashup. API Endpoint The API endpoint that you want to invoke in the mashup step. The API must be published on the current API Gateway instance. API Gateway API The endpoint of the API that you want to use. You can type a few letters and select from the autocomplete list. Resource The resource in the API that you want to use. You can type a few letters and select a resource from the autocomplete list. Method The specific method of the resource that you want to invoke. Execute outbound authentication policy Select if you want the outbound security policies of the participating API to be enforced in the context of an API mashup. Headers Use incoming Headers Select to use the headers in the incoming request. Custom Headers Custom headers that you can add in addition or instead of the incoming headers. Each custom header must have the following fields: - Header Name
- Header Value
Query Parameters Provide the following values: - Query Parameter Name
- Query Parameter Value
Path Parameters Provide the following values: - Path Parameter Name
- Path Parameter Value
Payload Type the Payload. XSLT Document Click Add xslt document and select the XSLT file for transforming the payload. Provide the following values: - XSLT File
- Feature Name
- Feature value
For information about transforming the payload using XSLT, see Request Transformation.
XSLT Transformation alias Click Add xslt transformation alias and select an existing XSLT transformation alias. Advanced Transformation webMethods IS service Click Add webMethods IS service and provide the following values: - webMethods IS Service
- Run As User
- Select Comply to IS Spec
webMethods IS Service Alias For information about the webMethods IS Service Alias, see Invoke webMethods IS. Transformation Metadata Namespace Provide the following values: - Namespace Prefix
- Namespace URI
For information about transformation metadata, see Request Transformation.
Custom Pipeline Variables You can use custom pipeline variables to hold values that need to be used in another step of the API mashup. Provide the following values: - Name
- Value
Note: In several fields, such as Header Value within custom headers, Query Parameter Value, and Path Parameter Value, you can use values from previous steps and other data using the variable and alias framework provided by webMethods API Gateway. For more information, see Structure of an API Mashup.
-
Connect the step to
Start.
-
Click
Add aggregator to add an aggregator step.
Note: You can also add an aggregator step by connecting two invocation steps to the same previous step. An aggregator step is automatically added after the steps when you connect the second step to the same previous step.
-
If you have added the aggregator by clicking
Add aggregator, add the following
connections:
- Connect the steps that need to be aggregated to the aggregator step.
- Connect the aggregator step to the next step.
-
To add additional steps to the aggregated block, complete the
following steps:
-
To add a new step to the aggregated block, click
Add invoke and connect the new step to
the same previous step.
You can configure the properties of the new step immediately or later. For details on configuring the step properties, see step 7.
- To add an existing step to the aggregated block, delete the connections of the step, if any and then connect the step to the previous step for the aggregated block and the aggregator step.
-
To add a new step to the aggregated block, click
Add invoke and connect the new step to
the same previous step.
-
Click the mashup step and configure the properties of the mashup
step as desired.
You can configure the mashup step properties using the Mashup Aggregator action panel that appears on the right side of the mashup canvas when you click the aggregator step. You can configure the following properties using the Mashup Aggregator action panel:
Section Field Description Headers Use incoming Headers Select to use the headers in the incoming request. Custom Headers Custom headers that you can add in addition or instead of the incoming headers. Each custom header must have the following fields: - Header Name
- Header Value
Query Parameters Provide the following values: - Query Parameter Name
- Query Parameter Value
Path Parameters Provide the following values: - Path Parameter Name
- Path Parameter Value
Payload Type the Payload. XSLT Document Click Add xslt document and select the XSLT file for transforming the payload. Provide the following values: - XSLT File
- Feature Name
- Feature value
XSLT Transformation alias Click Add xslt transformation alias and select an existing XSLT transformation alias. Advanced Transformation webMethods IS Service Click Add webMethods IS service and provide the following values: - webMethods IS Service
- Select a Run As User
- Select Comply to IS Spec
webMethods IS Service Alias Select an existing webMethods IS service alias. Transformation Metadata Namespace Provide the following values: - Namespace Prefix
- Namespace URI
Custom Pipeline Variables You can use custom pipeline variables to hold values that need to be used in another step of the API mashup. Provide the following values: - Name
- Value
Mashup Response Transformation - Select Aggregate response
- Payload
Note: In several fields, such as Header Value within custom headers, Query Parameter Value, and Path Parameter Value, you can use values from previous steps and other data using the variable and alias framework provided by webMethods API Gateway. For more information, see Structure of an API Mashup. - Add, configure, and connect additional API invocation steps and API aggregator steps as desired.
-
Click
Save.
The mashup is created for the selected method.