51
Views
2
Comments
Exposing GET REST API for retrieving Entity data
Question

I am trying to expose a REST API that just returns all data for a given O11 database entity. Following the instructions here:

Expose a REST API - OutSystems 11 Documentation 

The part that I'm stuck on is Step 4 -

"Design the method as an action that retrieves or manipulates the data you are exposing. "

In my example, I have a GetProjects REST API method I created. I then attempted to build out the client action to retrieve an aggregate of the projects. I also attempted to add a JSON serialize step. Calls to my endpoint don't return any data, so I'm not sure what configuration is required here.

Does anyone have a pointer do an example / tutorial showing the full end-to-end process for getting a REST API exposed, including the design of the data action to prepare the data?

2019-01-07 16-04-16
Siya
 
MVP

Follow the below steps to expose GetProjects REST API

  1. Add an Output Parameters of Type 'List Projects' to the  RESTAPI Method ( GetProjects )
  2. Open RESTAPI Method ( GetProjects ) and drop and drop and aggregate and select the source as Projects.
  3. Assign the Output of aggregate to the output variable.
  4. Publish application and right click on the RESTAPI and select 'Open Documentation' and there you will be able to see the details of the API you just created.
UserImage.jpg
Chris Peltz

Thank you Siya. It was the output parameter that I was missing. It works now 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.