Let's create a sample REST API using OIC with below steps
Step1: Create REST connection
Step2: Create Integration by using REST connection
Step3: Configure parameters if any and response as well
Step4: Map the elements for response if required and validate
Step5: Activate the Integration and test
We need a REST connection to create REST API using OIC.
Navigate to Design --> Connections.
Create the connection using create button.
Select the security policy as Basic Authentication.
Test the connection.
Go to Integrations.
Provide the Integration Name and Integration Identifier and click on Create button.
Select the REST connection that we created earlier and give the endpoint name and description.
Click and continue button and configure the REST trigger by providing the end point URI (/{name}) so that we can pass name as part of URL and consume it and select the "Configure this endpoint to receive the response" to send the response upon calling REST API.
Click on Continue button and no need to configure the trigger parameters in this screen.
Add the below concat function and drag and drop the name from the left pane.
concat("Hi ",/nstrgmpr:execute/nstrgmpr:TemplateParameters/ns14:name,", How are you?")Go to the business identifiers.
Go back to all integrations after saving the integration to active the integration.
Enable the debug option to verify the logs and click on activate.
Refresh to check the status of the integration.
Pass the value in name and run.
No comments:
Post a Comment