Create Oracle OIC REST API

Create Oracle OIC REST API using our comprehensive guide. Explore these step-by-step instructions and expert insights on creating robust REST APIs in Oracle OIC, empowering seamless integration between applications and systems for enhanced efficiency and agility in your organization’s digital ecosystem. Below are the general steps to build a REST API endpoint in Oracle OIC.

Sign in to Oracle OIC and Create a new connection

Login to Oracle Integration Cloud console using your credentials. Go to Integrations -> Connections and click Create button and choose REST adapter and fill details as shown below. For more information on REST adapter, refer to link. Click create and choose “Basic Authentication” on next page and test/save you work.

Define a new connection to Create Oracle OIC REST API
Define a new connection in OIC using REST Adapter

Create a new Integration

As a next step we will now create a integration. Navigate to Integrations in OIC console and click create button and choose APP Driven Orchestration and fill in details as follows and click create. You will land in designer page of integration. Switch layout to Horizontal and choose our previously created connection in start activity.

Define a new integration to Create Oracle OIC REST API
Define a new integration to Create Oracle OIC REST API

Configure REST Endpoint in Oracle OIC

On next screen enter end point name and parameter details and check configure this endpoint to receive the response as shown below. Click next

Enter details on Rest endpoint resource configuration page

In next step as shown below, we need to set the default data type of parameters. We will leave operator as string and for num1 and num2, change these to integer data type.

Rest endpoint request parameters configuration

Now we will configure response payload. Choose response payload format to JSON Sample and also the media type of response body to JSON. We can provide sample JSON as an inline code. Enter below inline code in yellow highlighted sample JSON inline as in snippet below

{
"answer" : 786
}

Rest endpoint response payload configuration

Here our configuration of end point is complete with summary snippet given below. Click done to return to designer page in OIC.

Rest endpoint configuration summary

Design Integration Flow

Once the trigger is configured, we can now design the integration flow by adding various activities and transformations. Edit map to demo activity in designer view and create target node under response wrapper as shown below

Create target node in designer mapping view

We will XSLT functions i.e. choose, when and value-of to check if operator is ADD, then add num1 and num2, if it substract then num1 – num2 and if it is divide then num1 / num2 and so on. Mapping sample of add operator is shown below.

Using OIC XSLT operations for our Oracle OIC REST API

Similarly add logic for other operators and click validate in the end. You can also test this XSLT transformation here by using the Test functionality. As required by OIC, we need to choose business for tracking for successfully saving without errors. We can choose all parameters here as tracking and debugging purposes as shown below.

Setting Business identifiers for tracking and debugging

Activate and Test our REST Service Endpoint

Once you are satisfied with the configuration and mapping, its time to activate the integration to make it live. Activate the integration from integration page in OIC console and choose test to test it within OIC environment

Testing our OIC integration

You can test this REST service integration from your browser after getting endpoint URL from OIC console. Similarly, we can use postman to test end point providing you have required credentials and that user has access to OIC. In addition, you may need to check your firewall opening in Oracle cloud console before calling this service outside of OIC.

Create Oracle OIC REST API

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top