Skip to content

Latest commit

 

History

History
83 lines (44 loc) · 3.23 KB

rate-limit.md

File metadata and controls

83 lines (44 loc) · 3.23 KB

Limit API calls using Rate Limit

Steps

1. Create Application Plan

  1. From main dashboard, click Human Resource Services link to open Product dashboard page.

    rate limit

  2. Click Create Application Plan link.

    rate limit

  3. Enter Limit in the Name field then click Create Application Plan button.

    rate limit

  4. Click 3 dots menu then select Publish.

    rate limit

2. Configure Usage Limit at Product Level

  1. From Application Plans dashboard, click on the Limit application plan.

    rate limit

  2. Click on Limit (n) link to open Limits panel. Then click New usage limit link to open setting dialog.

    rate limit

  3. Select the Period unit and enter the number of calls that are allowed for 1 period unit. In this case, 10 API calls are allowed for each minute. Then click Create usage limit button.

    rate limit

  4. A usage limit should be created.

    rate limit

3. Configure Usage Limit at Backend (API) Level - An alternative to Product Level

Instead of configure usage limit at product level which the number of API calls are counted from every backend APIs, you can also configure usage limit at each backend API to have different usage limit as well.

The steps are almost the same as Product level configure except you have to do at Backend level as a figure below.

rate limit

4. Change Application Plan for Application

  1. Select Application -> Listing menu from left panel.

    rate limit

  2. Click Test Corp HR Mobile link to open application dashboard.

    rate limit

  3. In Change plan panel, select the Limit application plan then click Change plan button.

    rate limit

  4. The Application Plan for the application should be changed.

    rate limit

  5. Configure and change Application Plan do not require configuration promotion. If you go to Product's configuration menu, you'll see it says nothing to promote.

    rate limit

5. Testing

  1. Test the APIs using 3Scale API Testing (API Key Pair Auth) collection.

  2. Send any API request more than 10 times within 1 minute, you should get HTTP 429 status code as well as Usage limit exceeded message returned from API gateway as a screenshot below.

    rate limit