Wednesday, June 8, 2016

Oracle MAX: Building my first application (Part 1): Custom API design

In the last release of Oracle Mobile Cloud Service, Oracle Mobile Application Accelerator (Oracle MAX) and Location Services were released. In my first technical post about MCS 2.0 I am going to focus on Oracle MAX, the new tool that allows us to create applications without coding, and that will enable business users, and people that doesn't know about programming, to build applications easily.

This is a 2 part post where you can find:

Before that any user can create an application we have to design correctly our Custom API.

Oracle MAX uses business object, so first we need to define schemas for the endpoints.

In this quick example, in our Custom API we are going to have 2 endpoints

/posts that will return a list of all posts, and
/post/id that will give us the information of the post.

Now that we have our endpoints create we have to create schemas for them.
In the left hand side menu, we have to click on 'Schema', and if we don't have any schema yet, click on 'New Schema' button.

The first one is Post schema.

This is the base schema for the post object. Now we need to create a schema for every endpoint. 
For /posts endpints we will have getPosts

And for /posts/id endpoints we are going to create getPost schema.

The first step is completed. Now we need to associate the schema to each endpoints and create Mock Data in the responses to each endpoint.

At the moment it is mandatory, and if you don't have mock data you will not be able to create lists in the application. I would like to thanks Denis Tyrell and Laura Akel for their help with this issue.

For each endpoint we have to click on methods.

Then in responses we have to select the schema that corresponds to the endpoint by adding new Media Type.

And also adding mock data in examples tab.

Our first endpoints is finished, and our second endpoints will looks like:

The last step is to publish the API, because we will not be able to consume it if it is not published.
In API menu, right click on the desired API and click on Publish.

I am not going to implement the APIs as you cna check other posts like Post 1, Post 2, Post 3 or OTN Article. Implementation and design should be done by someone with development skills,

In the next post we will build the application itself and this step can be done by anyone, as the application development is based on wizards and we don't have to write any line of code.

No comments:

Post a Comment