QueryParam

Use the QueryParam policy to set, update, or delete a query parameter in the request.

Examples

Set using reference variable:

In this example, the value of the query parameter tenant is set to the tenant ID found in the API Gateway request context.

<queryParam
    xmlns="http://www.infor.com/ion/api"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    name="queryParam-example" displayName="queryParam-example" enabled="true" version="1.0">
    <action>set<action> 
    <paramName>tenant</paramName>
    <paramValue ref="context.tenant"></paramValue>
</queryParam>

In the example, reference is made to a variable in the context object. The context object is a shared dictionary of information that can be accessed from the policies.

Set hard-coded value:

In this example, the query parameter sort is set to the value true.

<queryParam name="queryParam-example" displayName="queryParam-example" enabled="true" version="1.0">
    <action>set<action>  
    <paramName>sort</paramName>
    <value>true</value>
</queryParam>

delete all:

In this example, all query-string parameters are being deleted. One reason you might want to do this is that the query-string values are used to create to create headers (using the Header policy) and you do not want the query-string values passed to the target server.

<queryParam name="queryParam-example" displayName="queryParam-example" enabled="true" version="1.0">
    <action>delete<action>  
    <paramName>*</paramName>
    <value>true</value>
</queryParam>

Configuration

Element name Default Presence Type Multiplicity
action n/a Required string (set or delete) 1
paramName n/a Optional string (for delete can be special value *) 1

paramValue

n/a Optional string 1

<queryParam> attributes

<queryParam name="queryParam-example" displayName="queryParam-example" enabled="true" version="1.0">
Field name Description Default Presence
name Name of this policy instance. N/A Required
displayName Optional
enabled Indicates if a policy is enforced or not. If set to false, a policy is turned off, and not enforced. true Optional
version Policy version. N/A Required

<action> element

The set action indicates the intention of this policy, which updates the query parameter value. Insert if the parameter does not already exist.

<action>set<action>

<name> element

Name of the affected query parameter.

<paramName>sort</paramName>

<value> element

Value of the query parameter being set.

<paramValue>true</paramValue>

The query parameter value can also make reference to a variable:

<paramValue ref="context.auth.tenant"/>