When defining the API, using the Quota Policy, the number of requests to be made to this API can be completed within a certain period. In this way, quota management is done for the API where only this policy is used. Other API requests are excluded from the quota application. Most of the products on the market provide quota application by making API definition. Although this method is a known method, the advantages and disadvantages experienced during the application are as follows.
- Allows you to apply quota to an API resource very quickly.
- Allows you to define quota overrun error message in API dig.
- When such a restriction is made, your API resources will not be protected in general. The quota applies only to the API resource for which the definition is made.
- If you want to apply quotas for all your API resources, you have to apply quota police on all API definitions.
How to configure API Based Quota management?
To manage Api-Based quota in ApiGo, first, log in to the administration panel with your ApiGo administrative account and follow the definition steps below.
- Click on the EndPoints step from the left menu and find the API definition for which you want to define the quota and click on the Edit link.
- Find the “Usage Quota Policy” policy on the right panel opened by clicking the Cops button and click it.
- In the Usage Quota Policy definition screen that opens, you can define the sample definition for the quota as shown in the figure.
The parameters specified in the Usage Quota Policy definition and their explanations are as follows.
- Max request per period: defines how many requests can be made for this API in a given period below.
- Quota reset every: It is used to determine what the quota period is. 4 different periods can be defined as Day, Week, Month and Year.
- Error Message: What should be the response message that the API will produce in case of exceeding the quota.
An example of the error message that will be generated by the API in case the quota amount is exceeded is as follows.