API / APIGEE Gateway Interview Questions
What is the AssignMessage policy and what can it do?
The AssignMessage policy is one of the most-used policies in Apigee. It lets you create, modify, or remove HTTP message components (headers, query parameters, form parameters, body, verb, path) on either the request or the response. It is used for protocol bridging, header injection, body transformation, and creating custom responses.
<!-- Set headers on the outgoing request to backend --> <AssignMessage name="AM.SetBackendHeaders"> <AssignTo createNew="false" type="request"/> <Set> <Headers> <Header name="x-internal-caller">apigee-proxy</Header> <Header name="x-correlation-id">{request.header.x-correlation-id}</Header> </Headers> </Set> <Remove> <Headers> <Header name="x-api-key"/> <!-- strip the key before forwarding --> </Headers> </Remove> </AssignMessage> <!-- Create a custom error response --> <AssignMessage name="AM.CustomError"> <AssignTo createNew="true" type="response"/> <Set> <StatusCode>403</StatusCode> <ReasonPhrase>Forbidden</ReasonPhrase> <Headers> <Header name="Content-Type">application/json</Header> </Headers> <Payload contentType="application/json">{ "error": "access_denied", "message": "You do not have permission to call this API." }</Payload> </Set> </AssignMessage> <!-- Change the request verb and path --> <AssignMessage name="AM.RewritePath"> <AssignTo createNew="false" type="request"/> <Set> <Verb>POST</Verb> <Path>/v2/orders</Path> </Set> </AssignMessage>
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
