OutSystems allows you to expose methods using a REST API. These methods can be organized under multiple REST APIs.
If you want to consume a REST API, check Consume REST APIs.
REST API Method Flow
When a request to your REST API Method is received, OutSystems executes the following flow:
- Security Validations: After receiving the REST API Method request, OutSystems executes the security validations according to the settings in REST API properties HTTP Security and Internal Access Only.
- OnRequest(): OnRequest callback allows you to run logic over the requests after receiving them.
- OnAuthentication(): OnAuthentication callback allows you to add basic authentication or custom authentication to requests.
- Parameters Deserialization and Validation: Deserialization of the input parameters and validation of the data types, mandatory values, etc.
- Execute Method: Executes the action that implements the REST API Method.
- Parameters Serialization: Serialization of the output parameters to return in the response.
- OnResponse(): OnResponse callback allows you to run logic over the responses before sending them. It is always executed, even in an error situation.
Articles in this Section
- Expose a REST API
- Expose a REST API to allow other systems to retrieve or manipulate information.
- Add Basic Authentication to an Exposed REST API
- Add basic authentication to the requests made to the REST APIs you are exposing.
- Add Custom Authentication to an Exposed REST API
- Customize the authentication logic used in your exposed REST APIs.
- Customize REST URLs
- Customize the URL of your exposed REST API methods according to your needs.
- Customize REST API Responses
- Customize the information sent in responses when exposing a REST API.
- Preprocess REST API Requests
- How to run logic before executing each request of an exposed REST API.
- Change the HTTP Status Code of a REST API
- How to send a specific HTTP Status Code in the response of an exposed REST API method.
- Throw a Custom Error in an Exposed REST API
- Check how you can send meaningful errors when a REST API method runs into an error.
- Document an Exposed REST API
- Add documentation to your REST API to help developers to integrate their applications with your system.