Read access to the database via API?
Question
Application Type
Reactive
Service Studio Version
11.10.22 (Build 41777)
Platform Version
11.12.0 (Build 29775)

Hello,

I would like to have read access to the database of my APP created in Outsystems. I want to be able to use the stored information in other programmes. Is there an API from Outsystems with which this access is possible? Can you give me a link to further information?

Many thanks and best regards
Michael

Champion
Solution

Hi Michael,


I cannot manage to configure the mapping shown in my Service Studio. After selecting "Output.Employees = GetEmployees.List" 

For this case, please check data type for Output.Employees. I think that is the problem.


For the postman test, few things must be check :

1. Type of API (GET, POST or other)

2. The API url, check the Outsystems for the url.

3. If you use try like my example, using parameter input, if yes, in the postman you must fill the body with JSON input.


Thanks

Champion

Hi Michael,


Yes you can, by creating REST API on Outsystems (https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Expose_REST_APIs/Expose_a_REST_API)

Basically, you create server action to read your databases, then expose REST API and to return the result of that server action.

I'll try to create oml for example.


Thanks

Champion

Hi Michael,


This is the sample oml


Thanks

ExampleAPI.oml

Hi Toto, thanks for the link and the example. I have also looked at the exercise "Exposing Application Data using REST (GET)" at https://www.outsystems.com/training/lesson/1853/exposing-application-data-using-rest-get.

On page 16 of the PDF, the assign is defined as follows:

I cannot manage to configure the mapping shown in my Service Studio. After selecting "Output.Employees = GetEmployees.List" the mapping looks like this:

Where could the error be?

I can't use the tool https://reqbin.com/ shown on page 19 because our Outsystems runs on premise and https://reqbin.com/ doesn't seem to have external access (from the internet) to the generated URLs. I would like to use Postman to test the Rest API. Can anyone help me how to configure Postman to use the tool for API testing? A pure GET command leads to an error.

Thanks a lot four your help and best regards,

Michael

Champion
Solution

Hi Michael,


I cannot manage to configure the mapping shown in my Service Studio. After selecting "Output.Employees = GetEmployees.List" 

For this case, please check data type for Output.Employees. I think that is the problem.


For the postman test, few things must be check :

1. Type of API (GET, POST or other)

2. The API url, check the Outsystems for the url.

3. If you use try like my example, using parameter input, if yes, in the postman you must fill the body with JSON input.


Thanks

Hi Toto, thanks for your help. You were right, there was an error in data type for Output.Employees.

I have found that for my current purposes it is sufficient to call the request URL in firefox. This way I get the answer and can test the function. This means that I do not need postman at the moment.

Thank you very much for your support.
Michael

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