I have the following problem trying to insert multiple request query parameter into the URI of a REST API.
I have the following situation. Using an URL with a single query parameter (process_phase_id={process_phase_id}) it works fine, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<api context="/enutrifood/bylocation" name="ENutriFoodByLocation" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/{localizationId}/messages?process_phase_id={process_phase_id}">
...............................................................
...............................................................
...............................................................
But if I have multiple query parameter divided by the & symbol, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<api context="/enutrifood/bylocation" name="ENutriFoodByLocation" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/{localizationId}/messages?process_phase_id={process_phase_id}&q2={v2}">
...............................................................
...............................................................
...............................................................
As you can see now the resource have 2 parameters:
<resource methods="GET" uri-template="/{localizationId}/messages?process_phase_id={process_phase_id}&q2={v2}">
Now if I save my API I am obtaining this syntax error message:
Why? What could be the problem? What am I missing? Have I maybe to escape in some way the & character? How can I fix this problem and use multiple query parameter in my API?