The Extract Path Parameters filter enables the API Gateway to parse the contents of a specified HTTP path into message attributes. This means that you can define HTTP path parameters, and then extract their values at runtime using selectors. For example, this is useful when passing in parameters to REST-based requests. For more details on selectors, see the topic on Selecting configuration values at runtime.
Complete the following settings:
Name:
Enter a descriptive name for this filter.
URI Template:
Enter the URI template for the path to be parameterized. This is a formatted
Jersey @Path
annotation string, which enables you to parameterize
the path specified in the incoming http.request.path
message
attribute. The following is an example URI template entry:
/twitter/{version}/statuses/{operation}.{format}
Path Parameters:
The Path Parameters table enables you to map the path parameters specified in the URI Template to user-defined message attributes. These attributes can then be used by other filters downstream in the policy. Click Add to configure a path parameter, and specify the following in the dialog:
Field | Description |
---|---|
Path Parameter |
Enter the name of the path parameter (for example, version ).
|
Type |
Enter the type of the path parameter (for example, java.lang.String )..
|
Message Attribute |
Enter the name of the message attribute that stores the parameter value
(for example, twitter_version ).
|
The following screen shows the example path parameters:
![]() |
The incoming http.request.path
message attribute is required as
input to this filter.
This filter generates the message attributes for the parameters that you specify in the Path Parameters table. For example, in the previous screen shot, the following attributes are generated:
-
twitter_format
-
twitter_operation
-
twitter_version