How to extract a Developer custom attribute to use in Assign Message in APigee

51 views Asked by At

I'm new to google apigee and need some help. I'm trying to get a custom attribute defined in Developer page to use it in an assign message policy to add it in the header of the target endpoint.

Can anyone help me with it?

I've tried some extract value policies, but without success. Google Apigee documentation lack of this my doubt.

1

There are 1 answers

0
evansche On

This advice may be off the mark depending on what portal solution you use. See: https://cloud.google.com/apigee/docs/api-platform/publish/intro-portals

You mentioned the 'developer page' as the source of some piece of custom information you want passed through to the target endpoint as an HTTP header attribute. I think that you are aiming at then is some developer-identity-related attribute, which would (in the Apigee ecosystem) have to come from either the "Developer" entity, or the "App" entity which encapsulates the relationship between your API customer/developer's credentials and the API Product concept of the proxy-endpoint. The Developer entity supports custom attributes: https://cloud.google.com/apigee/docs/api-platform/publish/adding-developers-your-api-product#custom-attributes

And, the App (Client Application) concept also supports custom attributes, as explained here: https://cloud.google.com/apigee/docs/api-platform/publish/creating-apps-surface-your-api

The gist then is to extend the Developer or the App with the custom attribute you require, on a per-developer basis if needed, and then use an AccessEntity policy in your proxy to extract that attribute and then AssignMessage to add it to the south-bound message headers.

https://docs.apigee.com/api-platform/reference/policies/access-entity-policy