Working with Visual Builder business object REST APIs

JT Thomas
Oracle Developers
Published in
3 min readSep 2, 2017

In Visual Builder Cloud Service, your business objects are accessible via REST. This blog demonstrates how to use those REST APIs from an external source using cURL command-line tool.

As a reminder, business objects (BOs) in Visual Builder are a set of fields upon which users may perform CRUD (Create-Read-Update-Delete) operations. Usually, those CRUD operations are performed within an Visual Builder generated User Interface form. However, external services may also call upon those BOs using REST. For example, a Process Cloud Service (PCS) process may need to update a BO after a process is complete, like changing a status field from “requested” to “approved.”

First, let’s define a simple business object within the Visual Builder data designer. This business object is called Customer and contains two fields: Name and State.

Let’s add a few rows of data by running the app and entering some new Customers.

One more setting in Visual Builder and we can access these objects remotely. In the Applications > Security page, set the Enables basic authentication for business object REST APIs.

Now let’s use an external tool to access the REST APIs. For illustration, I will use curl from a MacOSX terminal command line. First we need to know the endpoint for the API call. This can be found in the Application > General page under the Catalog API.

Since this app is in Development we will select the top URL which contains the describe file and will give us the endpoints.

https://oracleabcs1-abcspoc.builder.us.oraclecloud.com/design/BOsAtREST/1.0/resources/data/describe?metadataMode=minimal

Part 1: The Resource endpoints and GET request

The curl request requires a Basic header with the base64 encoded username:password of the a user with the Authenticated User role. An additional header which sets the Content-Type to application/vnd.oracle.adf.resourcesitem+json is also required.

The below screenshot, shows the request and output. (Portions of the user token has been obscured for security).

In this output, we see a resource called Customer. If we were to call that describe endpoint we would see the fields and action allowed as well. But more importantly, we can figure out the endpoint for our BO with this output.

https://oracleabcs1-abcspoc.builder.us.oraclecloud.com/design/BOsAtREST/1.0/resources/data/Customers

Call the same GET request against this endpoint and the response will contain all of the rows of data within that business object. To look at just one of the rows, add the primary key, which is the id of that row after the BO endpoint.

https://oracleabcs1-abcspoc.builder.us.oraclecloud.com/design/BOsAtREST/1.0/resources/data/Customers/2

--

--