Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

how to use custom attribute in apps to apply quota for a proxy

hi folks

I have two Apps named to test and prod. and I want my test app to be able to hit proxy only 10 times and prod apps are able to hit API proxy only 20 times we have quota attribute in product level but I don't want to use that I want to use custom attributes like set a value in custom attribute as 

counter = 10 (for test app)

counter = 20 (for prod app)

so how I refer to these custom attribute values in quota policy for I can be restricted users to hit proxy 

for now, I have two policy 

verify access key = verify the app

quota policy with below code 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Quota async="false" continueOnError="false" enabled="true" name="Quota-1">
    <DisplayName>Quota-1</DisplayName>
    <Properties/>
    <Allow count="3"/>
    <Interval>1</Interval>
    <TimeUnit>minute</TimeUnit>
</Quota>

any guidance or help would be really helpful

@anilsagar @Former Community Member @Former Community Member  please have a look

Solved Solved
0 10 1,059
1 ACCEPTED SOLUTION

@rohanjangid - Yes, this is simple. Make sure the VerifyAccessToken or VerifyAPIKey policy gets executed. Once its verified the token or API Key, then it automatically populates many variables. The app's custom attribute also gets populated. 

Flow variables for Verify API Key policy is documented here

Flow variables for VerifyAccessToken is documented here

Depending on which policy you are using, you can use the appropriate flow variable name in the Quota policy. I would recommend you to use the Apigee Trace/Debug UI to see the name of the variable and see if its getting populated correctly and then use that in the Quota policy.

 

View solution in original post

10 REPLIES 10