In this post we will see how to call rest api in vbcs. This is particularly useful in when interacting with fusion applications, though its not limited there. You may need to use rest api call to do CRUD operation in Business objects as well.
Steps to call a Rest Api in Oracle VBCS
How to Call rest api and Populate in List in Oracle VBCS
Create a New Application
Create a New Application in VBCS .Go to Services Menu and Create a Service Connection
Select Define by End point
You will be presented with 3 opitons , select from catalog, define by specification and define by endpoint. Select Define by Endpoint. Hit Next button
Enter the Rest Api Url
You will be presented with screen to enter the Rest service url. Enter your url and hit next button below.
Enter Api Credentials in Server Tab
Go to the Server Tab in the next screen and click on authentication. If your rest is based on basic authentication select basic and enter the username and password in the pop up.
Test the Service Connection
No to to Test Tab and click on send request . A successful call with return the rest api response.
Save Example Response. Your Rest api is configured . Note the connection name in the left navigator panel to be used later.
Add a Combo box one to your application
To test the service connection . add a combobox one and click on add data options
Select the Service connection in Add data options
Select the conenction ( our example Crmservice ) and operation Get
Map the field from rest response to target LOV field and value
Do the mapping of field you want to show on lov screen. We are selecting organization name and label and value. means it will show the same field in list and pass the same field when selected. these values can be different e.g you can select org id in value based on your requirement.
Run the Application or go in live mode
Click on the LOV and you will see the values populated from Rest Response.
So these were the set of steps to call a rest api in vbcs and populate it in a list of values field.