Interceptors

Users can instruct the API Gateway to execute code snippets in the request or response flow of an API. This can be used to customize its behaviour in different situations.

For example, you may write a script that adds a header to the request depending on the tokens being used, or modify the response body that will be returned to the client in case of internal errors in the backend (to avoid exposing internal details).

There are many different interceptors available on your API Manager, divided into five categories: Traffic, Tracing, Security, Transformation, and Mediation. They are our default interceptors and you can learn more about each of them in the following subsections.

Also, the API Manager allows the creation of custom interceptors. They should be used for validations and situations which cannot be resolved by an existing interceptor. Please note that a custom interceptor consumes extra time on each request.

Currently, the API Manager allows the creation of custom interceptors in two languages: Java and JavaScript. For Java, the user must import a .jar file to include their custom interceptors (read more about it on the leia mais na documentaĆ§Ć£o sobre Custom Java page). If you prefer JavaScript, the platform provides an advanced editor for creation, including an autocomplete feature for proprietary attributes and functions of the API Gateway. To read more about it, read the Custom JavaScript page.

The image below shows the page where you can see all existing interceptors, as well as create and edit custom interceptors (using Java or JavaScript):

overview

You can add both default and custom interceptors on the Flows stage of API creation. You can read more about API flows here.

Thanks for your feedback!
EDIT
How useful was this article to you?