You can dynamically invoke a REST endpoint/URL at runtime without configuring additional invoke connection or REST outbound details. As long as the Oracle ERP Cloud REST APIs return a response with HATEOS links, you can use this feature by mapping the HATEOS link to the invoke connection. This feature is useful in situations that require invoking a REST endpoint dynamically or when the endpoint is not known at design time. This feature is also useful in situations that require invoking multiple REST services, all of which accept the same input payload and return the same response payload as configured for the outbound endpoint. For these cases, this feature eliminates the need to create multiple connections to invoke each REST endpoint.
Note the following restrictions.
The request and response schema must be the same as provided during endpoint configuration.
Template parameters are not supported while mapping these properties.
The HTTP verb cannot be changed for the endpoint URL. For example, if the endpoint is configured to use POST, the outgoing request uses POST even if the endpoint URI changes at runtime.
Because the endpoint URL is determined at runtime, there is no facility to test whether the security credentials provided during connection configuration also work with the new endpoint URL. If you think the endpoint URL determined at runtime requires a different authorization header then the original URL, you may need to provide a mapping for the authorization standard header.
An initial invoke is configured to get the Account object by using the REST API. The response of this REST API does not provide the child objects. Instead, there are HATEOS links to the child objects (that is, the Primary Address object).
A second invoke uses the HATEOS links from the earlier response to make another invoke connection to the REST endpoint to fetch the child Primary Address object using dynamic REST endpoint support.
To change the endpoint configuration at runtime, you map one or more of the various properties under the ConnectivityProperties target element.
- Create an orchestrated integration.
- Drag an adapter into the integration canvas as an trigger connection (it can be any adapter).
- Configure the adapter in the Adapter Endpoint Configuration Wizard.
- Drag an initial Oracle ERP Cloud Adapter into the integration canvas as an invoke connection.
- Configure it to use the crmRestApp service application, the Account object (business resource), and the get operation.
The response of the first invoke connection contains a collection of HATEOS links, each pointing to a child object such as Primary Address.
- In the mapper between the trigger adapter connection and the Oracle ERP Cloud Adapter invoke connection, map source elements to target elements. For this example, a PartyNumber source element is passed to an id target element.
- Add a for-each action to iterate between the HATEOS links. The value in the Repeating Element field is from the response object.
- Add a switch action to get the HATEOS link corresponding to the Primary Address object.
- Drag the Oracle ERP Cloud Adapter into the switch action as the second invoke connection.
- Configure it to use the crmRestApp service application, the Primary Address object (business resource), and the getAll operation. This object uses dynamic REST endpoint support. The Primary Address is a collection of links. The getAll operation is selected for getting all the HATEOS links.
- In the mapper immediately before the second Oracle ERP Cloud Adapter invoke connection, expand RestApi under ConnectivityProperties in the target section.
- From the source section, map href to AbsoluteEndpointURI under ConnectivityProperties. The ConnectivityProperties schema element supports dynamic REST endpoints. The href element points to the Primary Address object link. The href element is invoked by the Oracle ERP Cloud Adapter.
- If necessary, map other nodes under ConnectivityProperties. The runtime values provided by these mappings dynamically configure the request.
You can also hover the cursor over these properties for brief descriptions.
Element Description AbsoluteEndpointURI
Represents the absolute endpoint URL that the REST Adapter invokes. Empty values are ignored. To route the request to an endpoint URL determined at runtime, provide a mapping for this element. AbsoluteEndpointURI takes first precedence among other URL-related properties under ConnectivityProperties.
The equivalent of the base URL provided during connection configuration. To substitute only the base URI and retain the rest of the URL, provide a mapping for this element. The mapping is ignored if AbsoluteEndpointURI has a nonempty runtime value.
Forms the part of the endpoint URI between BaseUri and ?. The mapping has no effect if BaseUri has an empty runtime value or AbsoluteEndpointURI has a nonempty runtime value. The runtime value must start with a /.
Use the various elements under this node to substitute runtime values for the specific parts of an endpoint URL.
Provide a mapping to change only the scheme of the endpoint URL. Supported values are HTTP and HTTPS.
Provide a mapping to change only the Host portion of the endpoint URL
Provide a mapping to change only the port of the endpoint URL.
Provide a mapping to change only the query portion of the endpoint URL. A query portion follows the ?.
Provide a mapping to change only the path portion of the endpoint URL. A Path is the part of a URI between the hostname and ?.
The various properties under this node impact the way the REST Adapter invokes the endpoint URL.
When the runtime value is true and the HTTP verb is POST, the query string parameters are sent using POST as form parameters. The default is false.
When the runtime value is false, the REST Adapter uses RFC 3986-compliant encoding to encode the query parameters. The default is true. This is the equivalent of setting the custom header x-ics-use-x-www-form-urlencoded to false. See section “RFC 3986 Support for Encoding Query Parameters” for more information on x-ics-use-x-www-form-urlencoded. x-ics-use-x-www-form-urlencoded takes precedence when both are set.
- Drag an FTP Adapter to the switch action for writing the Primary Address object response to a file on an FTP server.
- In the mapper between the Oracle ERP Cloud Adapter and the FTP Adapter, map the Primary Address object details.
- Activate and invoke the integration. The Oracle ERP Cloud Adapter invokes the endpoint URI determined at runtime.