I tried using the AssignMessage Policy below
<AssignMessage name="AssignMessage-3"> <AssignTo createNew="true" type="request">request1 </AssignTo> <Add> <QueryParams> <QueryParam name="ql">select password where username='{proxy.username}'</QueryParam> </QueryParams> </Add> <AssignVariable> <Name>request.verb</Name> <Value>GET</Value> </AssignVariable> <AssignVariable> <Name>target.url</Name> <Value>https://api.usergrid.com/nagashree.b/digitalbranch/appusers</Value> </AssignVariable> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> </AssignMessage>
Couldnt get it to work. Tried javascript callout on the target endpoint as well.Couldnt get that to work as well. Any pointers if i am missing something or doing something really stupid?
var username = context.getVariable("apigee.username"); var targeturl = "https://api.usergrid.com/nagashree.b/digitalbranch/appusers"; targeturl = targeturl+"?ql=select password where username='"+username+"'"; conte xt.setVariable('target.url', targeturl); context.setVariable('target.verb', 'GET');
Solved! Go to Solution.
Resolved it. Seems very silly, I had no content-type header set in the POST request :(. Lost close to 3 hours due to that.