blank apiproduct.name flow variable

Hi!

I'm trying to get the value of the variable apiproduct.name on the preflow, however, then I'm doing a trace of an api proxy, such variable is blank, no value.

I noticed when I create api products with the legacy format (setting an api proxy list instead of operations and resource paths) the value is present, but when creating api products with resource paths and operations, the value is blank.

Is there any way to get the apiproduct.name value? changing the api product format to legacy is not an option, I need the new format.

Anyone could give me a hand, please?

Daniel.

Solved Solved
1 4 391
2 ACCEPTED SOLUTIONS

??

I don't see the behavior you're describing. This tutorial uses the "new" API product operations configurations. The instructions tell you to run a setup script, and then send an API request in. The response is a JSON payload, and one of the fields in that JSON is populated by the apiproduct.name context variable. It just works.

it-works-for-me.png

Can you try that to see if it works for you? (The sample will work only in Apigee X or hybrid.)

Maybe there is something else happening that causes the variable to not be set . The scenarios that seem most likely:

  • there has been no VerifyApiKey or VerifyAccessToken executed (yet?). If you check the variable before executing one of these policies, the variable will be empty / null.
  • One of those policies executed, but failed to find an API Product match.

View solution in original post

No worries, it happens to all of us.  It's nice to have an extra set of eyes, sometimes.

View solution in original post

4 REPLIES 4

??

I don't see the behavior you're describing. This tutorial uses the "new" API product operations configurations. The instructions tell you to run a setup script, and then send an API request in. The response is a JSON payload, and one of the fields in that JSON is populated by the apiproduct.name context variable. It just works.

it-works-for-me.png

Can you try that to see if it works for you? (The sample will work only in Apigee X or hybrid.)

Maybe there is something else happening that causes the variable to not be set . The scenarios that seem most likely:

  • there has been no VerifyApiKey or VerifyAccessToken executed (yet?). If you check the variable before executing one of these policies, the variable will be empty / null.
  • One of those policies executed, but failed to find an API Product match.

Seems like in my proxy building, the VerifyAccessToken policy is after the Assign Message in where I try to read the variable. I didn't realize that. My bad.

I'm gonna check it out.

No worries, it happens to all of us.  It's nice to have an extra set of eyes, sometimes.

Sorry for the late. I was super busy in my side.

Yes, that was! I appreciate to have extra eyes to realize it!

Thank you very much!