Custom Attribute from Product

Not applicable

I'm trying to add a custom attribute from my products after the clients have passed in an apikey. I cannot seem to get the custom attribute from the product with that apikey. I cannot find anything in the support documents to do this, how do we get the custom attributes from our products?

I'm using this to try and add a custom attribute to my header but I only see a blank header for value:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
    <DisplayName>Assign Message 1</DisplayName>
    <FaultRules/>
    <Properties/>
    <Remove>
    </Remove>
    <Add>
        <Headers>
          <Header name="Value">{apiproduct.Value}</Header>
      </Headers>
    </Add>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

I've also tried going with developer.app.Value and still not getting the custom values.

Solved Solved
0 3 1,607
1 ACCEPTED SOLUTION

Not applicable

After the VerifyAPIKey policy executes, variables will be automatically populated with information about the developer, developer app, API products, etc. Try referencing the following variable for API product info:

verifyapikey.{policy_name}.apiproduct.{custom_attribute_name}

where {policy_name} is what you named the VerifyAPIKey policy.

Docs page for reference:

http://apigee.com/docs/api-services/content/verify...

View solution in original post

3 REPLIES 3

Not applicable

After the VerifyAPIKey policy executes, variables will be automatically populated with information about the developer, developer app, API products, etc. Try referencing the following variable for API product info:

verifyapikey.{policy_name}.apiproduct.{custom_attribute_name}

where {policy_name} is what you named the VerifyAPIKey policy.

Docs page for reference:

http://apigee.com/docs/api-services/content/verify...

I think an example should be given in the api docs something like "{verifiyapikey.your-policy-name.apiproduct.custom-variable}" in the yellow box like the previous examples.

With verifyapikey, I was able to grab the custom attributes for only the first products in the list. How can I get for each products?