We have just demonstrated how you can configure Rate Limits within a Plan that will apply to every API within the Plan. You can also apply this Plan to specific APIs. This option is at the bottom of the Plan configuration, under the Plan APIs section. By selecting the Customize the Plan API list radio button, you can choose which APIs within the Product that the current Plan will apply. The following screenshot shows our Bronze Plan, which contains Member API within the API list once the Customize the Plan API list radio button is selected:
Figure 10.11 – Applying a Plan to select APIs
Clicking the ellipses to the far right of an API will allow you to remove it from the Plan list or even select the operations within the API you would like to include in the Plan.
Now that you have seen how to include or exclude Rate Limits in a Plan, let’s take a look at how we can override Plan Rate Limits for specific operations.
Defining Rate Limits for specific API operations in a Product
As we progress through our discussion on defining Rate Limits, we will continue to get more and more granular with our Rate Limit configuration. The most granular method within a Plan is to apply Rate Limits to specific operations defined within an API. From within the Plan configuration, you can select an API and then an operation from within that API to override all the other Rate Limit configurations within the Plan. Unlike applying the Rate Limits to only certain APIs within your Plan, this configuration will only override any other Rate Limit configuration you might have. This means that any Rate Limit configuration within the Plan will apply to all other APIs and operations. This override configuration will only apply to the specified API operations.
To configure a Rate Limit override for a specific operation, you must scroll to the bottom of the Plan configuration page, where you will find a check box labeled Override Plan Rate Limits for individual operations. Checking this box and clicking the Add button, as shown in the following screenshot, will bring you to a screen where you can select a specific API operation and configure the Rate Limit to apply to it:
Figure 10.12 – Selecting Override plan rate limits for individual operation
Now, you can select an API, and then an operation within that API, to apply a new Rate Limit to override any existing Rate Limits. The following screenshot shows our Plan overriding the addPatient operation within the member-api1.0.2 API with a new Rate Limit of 25 calls per 1-hour time period. You will configure this new Rate Limit in the same manner that you configured the Rate Limit for the Plan:
Figure 10.13 – Configuring the Rate Limit for a specific API operation
Once your new Rate Limit override is complete, click the Save button to save it.
With that, you have seen the power and flexibility of configuring Rate Limits within your Plans. You can configure many different Rate Limits per Plan at the Plan level and/or the operation level. You can apply your Plan to certain APIs so that the Rate Limits only apply to them. Given this flexibility, you should be able to accommodate almost any situation to apply Rate Limits at a broad or granular level.