Notify user when the quota limit is reached for the application

Not applicable

We develop the Developer Portal based on the Developer Portal Drupal distribution provided by Apigee.

Each user application has two or more products. Almost every product has a quota for the number of requests.

There is a task to notify the user that the application has exceeded the permissible quota of requests and showing this information in the list of applications on DevPortal. There are methods for obtaining analytical data about the application, but since quotas can have complex rules, therefore, to obtain analytical information about the quota, a complex query and calculations will be required. Is there simple an REST API call that can be used to uniquely determine whether the application (User's API Key) exceeded the quota at this moment?

It can be possible to set up on the Apigee side when the App quota limit is reached Apigee notify user by mail?

0 3 595
3 REPLIES 3

Not applicable

Hi Anton Gunosov,

When the App reaches its quota for an API product it will get an error message back. So I would think its probably best that the app trigger an email alert / or any other form of notification to the app developer saying it has reached its limit for the API product. Now this is a logic which the app can reuse for all other API products it has subscribed to. Rather than having to write fault notification rules within Apigee I would suggest to have this logic in the App end, which is ideal.

Thanks

Prakash

I loading list of App in DevPortal by this function entity_load('developer_app', FALSE, array('mail' => $user->mail));

But this function not gets any info about App reaches its quota for an API product.

Each app may have different products with different proxy edpoints.

Function devconnect_developer_apps_get_api_products() gets info about products, but not get info about product endpoint that I can use for getting response with quota limit error.

How check on DevPortal level that app reaches its quota?

Hi @Anton Gunosov

Welcome to the community !! When the quota policy is executed, there are few flow variables that gets populated for example - ratelimit.{policy_name}.allowed.count, ratelimit.{policy_name}.used.count, ratelimit.{policy_name}.available.count and many more. For more details, check this link.

Once you know what is the limit, there are few possible solutions:

  1. Send the quota count remaining or whatever is useful to the developer via response headers so that they can handle at their end
  2. Have another API that can send emails and trigger that via a Service callout policy with a condition checking these quota limits that gets populated after the Quota policy is executed.