Set up limit notifications

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Introduction

You can set monetization-related limits, as described in Enforcing monetization limits using the Monetization Limits Check policy. You can also set up automatic notifications that alert developers, and/or users in your organization, when a limit is approaching or is reached.

You can set up automatic notifications for custom limits as well as implicit limits. For example, the system sets an implicit limit for your prepaid developers, which is their prepaid balance. You can set up automatic notifications so that your developers are notified if they are approaching or have reached their prepaid balance.

Toolbox

You can set up automatic notifications for limits using the management UI or monetization API. If you use the UI, you set up automatic notifications on the Notifications page.

If you use the API, you set up automatic notifications for limits by editing a notification template provided by monetization. You then specify the condition that results in sending the notification provided by the edited template.

Setting up limit notifications using the UI

  1. Click Add in the Notifications section of the Add Limit page. This opens the Notification section.

  2. Select a level for the notification. This is a threshold based on an absolute number or a percentage of the limit basis. Select:
    • The greater than or equal to sign (?) or the less than or equal to sign (?) from the drop-down menu.
    • A whole number (that is, no decimal places). Absolute (to indicate a number value) or Percentage to indicate a percentage value. For percentage limits, always ensure you set the limit to as >, which means that the notification is sent when the developer reaches or crosses that percentage level.

    For example, if you set a spend limit of $100 and you set the notification at greater than or equal to 90%, the notification will be sent when 90% of the limit ($90) is reached or exceeded.

  3. In the Send Email field, select one or more developers, or select one or more users in your organization. Notification will be sent to the affected developers or users.

    Email recipients: You can only send notifications to developers if you set a Developer limit condition of "Any" or set a Developer limit condition with a specific developer. If you selected "Any", you will see "Selected developer (Any)" in the list of email addresses. This means that monetization will send a notification to any affected developers. If you selected a specific developer, you will see "Selected developer ({developer_id})" in the list of email addresses (where {developer_id} is the identification of the selected developer). Monetization will send a notification only to that specific developer.

    If you did not select a Developer limit condition of "Any" or a specific developer, you will not see "Selected developer (Any)" in the Send Email field. However, you can choose which of your organization’s users you want to notify.

    You can add email addresses for your organization’s users by selecting Organization Users in the Admin tab.

    Email templates: You will see an email template after you select in the Send Email field "Selected developer (Any)" or email addresses of users in you organization (or both).What appears in the template depends on the following:

    • The level of the notification.
    • Whether or not the limit was a halt execution limit.
    • Whether the email was for organization users, developers, or both.

    For example, if all of the following are true:

    • The Halt execution checkbox is checked.
    • The level of notification is 100% or the same amount as the limit.
    • The email is for organization users only.

    The template looks like this:

    Assume that the developer’s company name is "XYZ company", the transaction volume limit is set at 50 for an API package named "X Package" and an API Product named "Y Product", and the expiration date is set at September, 30, 2013. The email message that is sent would look like this:

    Developer XYZ company has exceeded their transaction volume limit of 50 transactions for X package, Y product. Their API calls will be blocked till 2013-09-30
    

    If the email is to "Selected developer (Any)", the template appears as follows:

    Both templates will resolve the relevant variables such as developer name (if applicable), package name (if applicable), and product name (if applicable). You can edit the message to meet your requirements by clicking Edit to the left of the template.

    If the limit is for "Any" or a specific application and "Any" or a specific user, you also need to add variables for the application(s) and user(s) to the template. You can do this as follows:

    • Click Edit to the left of the template.
    • Add ${user.name} user, depending on whether the limit is for application and/or user.

    A template edited for "Any" or a specific application is shown below.

    If Halt execution is not checked, or the notification level is greater than or equal to 100%, the template for a selected developer looks like this:

    Again, if the limit is for "Any" (or a specific) application, or "Any" (or a specific) user, you need to edit the template and then add ${application.name} application and/or ${user.name} user, depending on whether the limit is for an application, a user, or both.

    Template variables: When you edit the message in an email template, you can include any of the following variables.

    Variable Description
    ${developer.name}

    The name of the developer.

    ${developer.legalName}

    The name of the developer’s company.

    ${ratePlan.monetizationPackage.displayName}

    The name of the API package.

    ${application.name}

    The name of the application.

    ${USER}

    The name of the user.

    ${USAGE}

    Current usage (total revenue or charges, or volume).

    ${PERCENT}

    The percentage of the limit reached by current usage.

    ${QUOTA_TYPE}

    The type of the limit (transaction volume, spend limit, or fee exposure).

    ${QUOTA_UNIT}

    The basic unit for the limit: currency (for a spend limit), or calls (for a transaction limit).

    ${QUOTA_LIMIT}

    The amount of the limit.

    ${EXPIRY_DATE}

    The date or time that the limit expires or when it gets reset.

    For example, if you want to be notified when any developer has reached a certain percentage of transaction volume for any package on any application, you can edit the template to look like this:

    ${developer.legalName} has reached a total volume of ${USAGE} on ${ratePlan.monetizationPackage.displayName}. This is ${PERCENT} of the daily/weekly/monthly (state period of limit as appropriate) transaction volume limit of ${QUOTA_LIMIT}.
    
  4. Add notifications as needed for additional levels. For each additional level, click Add. This adds a Level, Send email, and Email template area to the Notifications section of the page. You can add up to 6 levels for your notifications. For example if you set the notification as > 70%, 80%, 90%, 100%, then a notification will be sent when each of these levels are reached.
  5. After you add all notifications, click Save (to save and publish the notifications at a later date), Save and Publish (to publish now), or Cancel (to cancel).

Setting up limit notifications using the API

Monetization provides a set of templates that provides the text for various types of notifications, including limit notifications as well as ad-hoc notifications such as alerting developers about the availability of new products. You can tailor any of these templates to meet your needs. To set up an automatic limit notification, first edit an appropriate template. Then specify the condition that results in sending the notification provided by the edited template. For further details, see Set up notifications using notification templates.

Next steps

Learn how to set up automatic notifications so that you can alert developers about events such as new products, new versions of T&C's, or new rate plans. See Set up notifications using notification templates.