how to get developer email using access entity and set this in a header

i have an proxy with simply endpoint of https://mocktarget.apigee.net/json and inside this proxy i added a access entity policy and inside this policy what i wrote so i can get developer mail id in body whenever anyone hit on api

this is my access entity policy

10806-screenshot-142.png

here i am extract variable

10807-screenshot-143.png

here i am using assign message policy

10808-screenshot-143.png

and here is the result

10809-screenshot-145.png

10810-screenshot-146.png

and here is the result when i hit api "{"fault":{"faultstring":"AccessEntity.GetDeveloperProfile message is not available for ExtractVariable: SetDeveloperProfile","detail":{"errorcode":"steps.extractvariables.SourceMessageNotAvailable"}}}"

please let me know where i made mistake

0 2 272
2 REPLIES 2

It looks to me that you have a series of 3 policies configured to execute:

  • GetDeveloperProfile (AccessEntity)
  • SetDeveloperProfile (ExtractVariables)
  • EchoVariables (I don't know what this is)

And you are seeing a failure in the 2nd step, the ExtractVariables. It's telling you, there's nothing in AccessEntity.GetDeveloperProfile, which you have configured as the Source for the ExtractVariables policy.

That tells me that the AccessEntity did not set the variable as you expected it would.

Looking at the trace screenshot, I don't see a value displayed for request.queryparam.apikey. The screenshot in your post right after "here is the result" shows what appears to be a READ of the variable request.queryparam.apikey, returning no value.

Have you passed a valid apikey as a queryparam? If not, what happens if you pass a valid apikey as a query param?

ps: I have an additional hint.

The AccessEntity policy will set a variable containing the entire XML content. That is the thing you are referring to as the Source in the ExtractVariables policy.

But AccessEntity also sets other variables, for the specific XML nodes in the retrieved content.

You don't need to call ExtractVariables. You can just refer to the variable AccessEntity.AE-Developer.Developer.Email .

See also, another answer to your duplicate question.