Skip to main content
Feedback

Expression Language Request

EL can be used to access request properties and attributes as described below.

Request object properties

The object properties you can access from the {#request} root-level object property and use for API requests are listed below.

Object PropertyDescriptionTypeExample
contentBody contentstring
contextPathContext path. {#request.content} is only available for policies bound to an on-request-content phase.string/v2/
headersHeaderskey / valueX-Custom → myvalue
hostThe host of the request. This is preferable to using the Host header of the request because HTTP2 requests do not provide this header.stringboomi.example.com
idIdentifierstring12345678-90ab-cdef-1234-567890ab
localAddressLocal addressstring0:0:0:0:0:0:0:1
methodHTTP methodstringGET
paramsQuery parameterskey/valueorder → 100
pathPathstring/v2/store/MyStore
pathInfoPath infostring
pathInfosPath info partsarray of strings[,store,MyStore]
pathParamsPath parameterskey / value
pathParamsRawPath parametersstring/something/:id/**
pathsPath partsarray of strings[,v2,store,MyStore]
remoteAddressRemote addressstring0:0:0:0:0:0:0:1
schemeThe scheme of the request (either HTTP or HTTPS)stringhttp
hoststring
sslSSL session informationSSL object
timestampTimestamplong1602781000267
transactionIdTransaction identifierstringcd123456-7890-abcd-ef12-34567890
uriURIstring/v2/store/MyStore?order=100
versionHTTP versionstringHTTP_1_1

Examples

  • Get the value of the Content-Type header for an incoming HTTP request using {#request.headers['content-type']}

  • Get the second part of the request path using {#request.paths[1]}

Request context attributes

When APIM Gateway handles an incoming API request, some object properties are automatically created or added during the execution phase through the Assign Attributes policy. These object properties are known as attributes. Attributes can be accessed from the {#context.attributes} root-level object property.

Request context attributes and examples are listed below.

Object PropertyDescriptionTypeNullable
apiCalled APIstring
api-keyThe API key used (for an API Key plan)stringX (for no API Key plan).
applicationThe authenticated application making incoming HTTP requests.stringX (for Keyless plan)
context-pathContext pathstring
planPlan used to manage incoming HTTP requests.string
resolved-pathThe path defined in policies.string
user-idThe user identifier of an incoming HTTP request: - The subscription ID for an API Key plan - The remote IP for a Keyless planstring

Examples

  • Get the value of the user-id attribute for an incoming HTTP request using {#context.attributes['user-id']}

  • Get the value of the plan attribute for an incoming HTTP request using {#context.attributes['plan']}

On this Page