Call Rest Api form JavaScript in VBCS

 Usually REST Api’s are triggered from Action, but there are some standard JavaScript Libraries which we can use to call REST Api’s from JS Code.

  • Create a sample VBCS WebApp
  • Create a Connection for Rest Api

  • Create a button in Ui and add an ojAction to it.

  • Create below function to make a call to the Rest Api

  • Call this function from Button Action, we need to pass endpoint name and q parameter as parameters to the same.


  • Now run the application and clear the log and Network tab


  • Now click on the button and check the Network and Logs to see if the Rest Api is triggered or not.


Reference:


Comments

Popular posts from this blog

Mavenize an Oracle ADF Application

Creating Column Filter on a VBCS Table using ListDataProvider(LDP)

Using Custom Colors in Sunburst Chart