Override the Endpoint URI/Host Name for an External REST API at Runtime

You can design integrations in Oracle Integration in which you specify an endpoint URI at runtime to invoke an external REST API. This feature is useful in situations in which the endpoint of the external REST API is either not known at design time or a decision must be made by the integration at run time to determine which one of the multiple REST services must be invoked.

Perform the following steps to configure an integration to invoke a REST endpoint dynamically using Oracle Integration.

The integration is typically designed with the REST Adapter as an invoke connection. The connection has either the base URI or the absolute endpoint URI specified in a Swagger document. In either case, the endpoint URI for the external API is derived at design time, and is static.

In scenarios in which the endpoints are overridden at run time, it is assumed that the APIs hosted on these endpoints comply with the interface defined for the API at design time.

  1. Create and configure a REST Adapter as an invoke connection.

    During design time configuration, the interface for the external API is being specified declaratively: the shape of the request and the response message (if any), the HTTP method used, and the message exchange pattern (request, response, or one way).

  2. In the Target section of the mapper, expand RestApi under ConnectivityProperties.

  3. From the Source schema, provide a mapping for AbsoluteEndpointUri.
    Description of rest_adapter_mapper3.png follows
    Description of the illustration rest_adapter_mapper3.png
    AbsoluteEndpointUri must be assigned the endpoint URI that has concrete values for the path/template parameters and any query parameters with values. The REST Adapter sends the request to the address stored in this property. Alternatively, you can also provide a static mapping.

  4. Activate and invoke the integration. The REST Adapter uses the runtime value provided by this mapping to determine the REST endpoint to which to route this request.

  5. Alternatively, in Step 4, you can map other siblings of AbsoluteEndpointUri. For a finer control, you can also provide mappings for individual components of the URI by expanding the URI.

    • Scheme: Provide a mapping if you want to change only the scheme of the endpoint URL. Supported values are HTTP and HTTPS only.

    • Host: Provide a mapping if you want to change only the host portion of the endpoint URL.

    • Port: Provide a mapping if you want to change only the port of the endpoint URL.

    • Query: Provide a mapping if you want to change only the query portion of the endpoint URL. A query portion is the one that follows the ? character.

    • Path: Provide a mapping if you want to change only the path portion of the endpoint URL. A path is the part of a URI between the hostname and the ? character.