Sometimes you might need your Application Builder Cloud Service app to interact with an external system or application.

One common way that external system expose for interacting with the is REST services.

In the demo below, we'll show you a simple way to invoke such a REST API and pass a value to it, with a button using a short JavaScript snippet.

 

Screen Shot 2016-03-21 at 12.01.46 PM.png

 

We are using a REST service that leverage the https protocol at https://api.github.com/users/oracle/repos

The service accepts a name of a company (oracle in the URL above) and returns a list of github projects.

 

In the demo you'll see how to:

Create a page that will allow you to input data directly, without the need for the regular "list->create/update" flow.

  • Add a button to call a REST service
  • Add a custom component to a page
  • Add JavaScript to call a REST service, pass a parameter, modify custom component
  • Modify menu to  have your page display first
  • Stage your application for testing

 

Check it out:

 

 

The JavaScript code we used is:

       $.getJSON("https://api.github.com/users/"+ +"/repos", function(result){

            $.each(result, function(i, field){

                $('[name="myOutput"]').append(field.name + " ");

            

            });

        });

resolve();

 

The custom HTML component we added was:

<div name="results">Results: </div>