How to configure the Rate Limit interceptor?
|
This interceptor can only be inserted into the request flow. The Flows section can be configured when creating or editing an API or Plan:
1. In the API
-
Go to API Design > API Catalog and find your API.
-
In the Flows section, click on Edit.
-
Click and drag the Rate Limit interceptor into the flow. Doing this will open a window with configuration properties.
-
Choose the configuration type between Total Calls and IP.
-
Selecting Total Calls limits requests by the number of calls, regardless of the source.
-
Selecting IP limits requests by IP. This means each IP will be able to access the configured number of times.
-
Selecting Header configures a specific header for traffic restriction. When selecting this option, you must enter:
-
Key: the desired header key.
-
Missing header behavior: configures the behavior for requests without the header. Choose between:
-
Allow: ignores interceptor processing, allowing the request flow.
-
Total Calls: treats the request based on the total number of calls.
-
Abort: blocks the request.
-
-
-
-
Enter the maximum number of calls in the Calls field.
-
In Interval, select the time period for limiting calls between Second, Minute, Hour, Day or Month;
-
If you want to add a percentage of calls above the allowed limit, check the Soft Limit option and enter the value in the percentage symbol field.
-
If you want to add a parameter to receive the remaining request quantity in the response header, check the Return quota header option.
-
Click Save to keep the changes.
You can follow the steps in this video:
2. In the Plan
-
Go to API Design > Plans and find your plan.
-
Click on Edit;
-
In the Flows section, click and drag the Rate Limit interceptor into the flow. Doing this will open a window with configuration properties.
-
Choose the configuration type between Total Calls and IP.
-
Selecting Total Calls limits requests by the number of calls, regardless of the source.
-
Selecting IP limits requests by IP. This means each IP will be able to access the configured number of times.
-
Selecting Header configures a specific header for traffic restriction. When selecting this option, you must enter:
-
Key: the desired header key.
-
Missing header behavior: configures the behavior for requests without the header. Choose between:
-
Allow: ignores interceptor processing, allowing the request flow.
-
Total Calls: treats the request based on the total number of calls.
-
Abort: blocks the request.
-
-
-
-
Enter the maximum number of calls in the Calls field.
-
In Interval, select the time period for limiting calls between Second, Minute, Hour, Day or Month;
-
If you want to add a percentage of calls above the allowed limit, check the Soft Limit option and enter the value in the percentage symbol field.
-
If you want to add a parameter to receive the remaining request quantity in the response header, check the Return quota header option.
-
Click Save to keep the changes.
Share your suggestions with us!
Click here and then [+ Submit idea]