Send Docs Feedback

Variables reference

Apigee Edge defines a set of variables that are available out-of-the-box. This document defines all of the variables the are "pre-defined" by API Services. 

If you're new to flow variables or have general questions about them, see Introduction to flow variables. For information about how variables are used in conditional flows, see Flow variables and conditions.

About variable scope

Flow variables have scope. By scope, we mean the point in the proxy flow life cycle when a variable is first instantiated. For example, if you have a policy attached to the ProxyEndpoint request segment, that policy will not be able to access any variables that are scoped to the TargetEndpoint request segment. The reason for this is that the TargetEndpoint request segment of the flow has not executed yet, so the API proxy hasn't had a chance to populate variables in that scope.

It's important to note that if you try to access a flow variable that is out of scope, you will receive a NULL value. If you try to set a flow variable before it is in scope, the proxy does nothing; it does not generate an error and does not set the variable.

For more information, see "Flow variable scope".

Request message variables

Using the variables that apply to the request message, policies may access message components including the header, the query parameters, and form parameters, the source IP address, the HTTP message body, and so on.

The proxy receives an incoming request message, then applies to it a series of policies, based on conditions evaluated on the request, which can modify or transform the request.  In the normal flow, the proxy then sends the transformed request to the target.

Policies can examine request variables, then transform or reject the request based on the content of those variables. Policies transform the request by setting the appropriate variables, for example variables corresponding to the request headers.

Request message variables Description
client.cn

Scope: Proxy request
Type: String
Permission: Read

The common name specified in the SSL certificate presented by the client app.

client.country

Scope: Proxy request
Type: String
Permission: Read

The country in the SSL certificate presented by the client app.

client.email.address

Scope: Proxy request
Type: String
Permission: Read

The email address in the SSL certificate presented by the client app.

client.host

Scope: Proxy request
Type: String
Permission: Read

The HTTP host associated with the request received by the ProxyEndpoint.

client.ip

Scope: Proxy request
Type: String
Permission: Read

The originating IP address of the request received by the ProxyEndpoint.

client.organization

Scope: Proxy request
Type: String
Permission: Read

 

The organization in the SSL certificate presented by the client. (Not necessarily equivalent to the organization on Apigee Edge.)
client.organization.unit

Scope: Proxy request
Type: String
Permission: Read

The organizational unit in the SSL certificate presented by the client.

client.locality

Scope: Proxy request
Type: String
Permission: Read

The locality (City) in the SSL certificate presented by the client.

client.port

Scope: Proxy request
Type: Integer
Permission: Read

The HTTP port associated with the originating client request to ProxyEndpoint.

client.received.end.time

Scope: Proxy request
Type: String
Permission: Read

The time, expressed in string form, at which the proxy finished receiving the request from the originating client at the ProxyEndpoint. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

client.received.end.timestamp

Scope: Proxy request
Type: Long
Permission: Read

The timestamp value specifying when the proxy finished receiving the request from the originating client at the ProxyEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

client.received.start.time

Scope: Proxy request
Type: String
Permission: Read

 

The time, expressed in string form, at which the proxy began receiving the request from the originating client at the ProxyEndpoint. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

client.received.start.timestamp

Scope: Proxy request
Type: Long
Permission: Read

The timestamp value specifying when the proxy began receiving the request from the originating client at the ProxyEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

client.sent.end.time

Scope: Proxy response
Type: String
Permission: Read

The time, expressed in string form, when the ProxyEndpoint finished returning the response to the originating client app. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

client.sent.end.timestamp

Scope: Proxy response
Type: Long
Permission: Read

The timestamp value specifying when the ProxyEndpoint finished returning the response to the originating client app. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

client.sent.start.time

Scope: Proxy response
Type: String
Permission: Read

The time, expressed in string form, when the ProxyEndpoint started returning the response to the originating client app. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

client.sent.start.timestamp

Scope: Proxy response
Type: Long
Permission: Read

The timestamp value specifying when the ProxyEndpoint started returning the response to the originating client app. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

client.state

Scope: Proxy request
Type: String
Permission: Read

The state in the SSL certificate presented by the client.

client.scheme

Scope: Proxy request
Type: String
Permission: Read

Returns http or https depending on the transport used by client app to send the request message.

client.ssl.enabled

Scope: Proxy request
Type: String
Permission: Read

Returns true or false, depending on whether the ProxyEndpoint is configured for SSL.

message.path

Scope: Proxy request
Type: String
Permission: Read/Write

The complete request message path in URL excluding any query parameters. 

message.queryparam.{queryparam_name}

Scope: Proxy request
Type: String
Permission: Read

Returns the specified message query parameter.

message.queryparam.{queryparam_name}.values.count

Scope: Proxy request
Type: Integer
Permission: Read

The total count of a specified query parameter associated with the request sent to the ProxyEndpoint from the client app.

message.queryparams.count

Scope: Proxy request
Type: Integer
Permission: Read

The total count of all query parameters associated with the request sent to the ProxyEndpoint from the client app. 

message.queryparams.names

Scope: Proxy request
Type: Collection
Permission: Read

A list of all query parameter names associated with the request sent to the ProxyEndpoint from the client app.

message.querystring

Scope: Proxy request
Type: String
Permission: Read

A string containing all query parameter names and values associated with the request sent to the ProxyEndpoint from the client app.

For example, where the request is: 

http://api.apifactory.com/inventors?name=nikola&surname=tesla

this variable returns:

name=nikola&surname=tesla

message.uri

Scope: Proxy request
Type: String
Permission: Read

The complete URI path (following the domain URL) including query parameters.

For example, where the request is: 

http://api.apifactory.com/inventors?name=nikola&surname=tesla

this variable returns:

inventors?name=nikola&surname=tesla

message.verb

Scope: Proxy request
Type: String
Permission: Read

The HTTP verb (GET, PUT, POST, DELETE, etc.) associated with the request

message.version

Scope: Proxy request
Type: String
Permission: Read/Write

The HTTP version associated with the request sent to the ProxyEndpoint from the client app.

messageid

Scope: Proxy request
Type: String
Permission: Read

Holds the globally unique ID for the request. This ID allows requests received at the router to be tracked after they are sent to the message processor. 

This ID is logged in Edge error logs to correlate the messageId with the errors. 

proxy.basepath

Scope: Proxy request
Type: String
Permission: Read/Write

The value of API proxy basepath that is sent from the client and received at the ProxyEndpoint.

The basepath is defined as the path component that uniquely identifies the API proxy. The public-facing URL of an API proxy is comprised of your organization name, the environment where the proxy is deployed, the basepath, the basepath suffix, and any query parameters. 

For example, in the following request:

http://myorg-test.apigee.net/v2/weatherapi/forecastrss?w=12797282

The basepath is /v2/weatherapi.

proxy.client.ip

Scope: Proxy request
Type: String
Permission: Read

The IP address associated with the HTTP request from the requesting client app.

proxy.pathsuffix

Scope: Proxy request
Type: String
Permission: Read

The value of API proxy basepath suffix that is sent from the client and received at the ProxyEndpoint.

The basepath is defined as the path component that uniquely identifies the API proxy. The public-facing URL of an API proxy is comprised of your organization name, the environment where the proxy is deployed, the basepath, the basepath suffix, and any query parameters. 

For example, in the following request:

http://myorg-test.apigee.net/v2/weatherapi/forecastrss?w=12797282

The basepath suffix is /forecastrss

proxy.url

Scope: Proxy request
Type: String
Permission: Read

Gets the complete URL associated with the proxy request received by the ProxyEndpoint, including any query parameters present.

request

Scope: Proxy request
Type: Message
Permission: Read

The complete request, including any payload present.

request.content

Scope: Proxy request
Type: String
Permission: Read/Write

Gets or sets the payload of the request message.

request.formparam.{formparam_name}

Scope: Proxy request
Type: String
Permission: Read/Write

Gets or sets the value of the specified form parameter in the request sent from the client app. 

request.formparam.{formparam_name}.
values.count

Scope: Proxy request
Type: Integer
Permission: Read

Count of all values for the specified form parameter associated with the request.

request.formparam.count

Scope: Proxy request
Type: Integer
Permission: Read

Count of all form parameters associated with the request sent from the client app. 

request.formparam.names

Scope: Proxy request
Type: Collection
Permission: Read

A list of all form parameter names associated with the request.

request.formstring

Scope: Proxy request
Type: String
Permission: Read

The complete formparam in the request sent from the client app.

For example: name=test&type=first&group=A

request.header.{header_name}

Scope: Proxy request
Type: String
Permission: Read/Write

Gets or sets the value of a particular header found in the request.

request.header.{header_name}.values

Scope: Proxy request
Type: Collection
Permission: Read

All the values of a particular header in the request

request.header.{header_name}.values.count

Scope: Proxy request
Type: Integer
Permission: Read

Count of all the values of a particular header in the request.

request.headers.count

Scope: Proxy request
Type: Integer
Permission: Read

Count of all the headers in the request.

request.headers.names

Scope: Proxy request
Type: Collection
Permission: Read

Names of all the headers in the request.

request.path

Scope: Proxy request
Type: String
Permission: Read/Write

The complete request path in the request URL excluding query parameters. This value is the same as the basepath and basepath suffix combined.

For example: If the basepath of the request is /123, and the basepath suffix is /456/hello, then request.path returns /123/456/hello.

request.queryparam.{queryparam_name}

Scope: Proxy request
Type: String
Permission: Read/Write

The value of a particular query parameter found in the request.

request.queryparam.{queryparam_name}.
values.count

Scope: Proxy request
Type: Integer
Permission: Read

The count of all the values of a particular query parameter in the request.

request.queryparams.count

Scope: Proxy request
Type: Integer
Permission: Read

The count of all the query parameters in the request.

request.queryparams.names

Scope: Proxy request
Type: Collection
Permission: Read

The names of all the query parameters in the request.

request.querystring

Scope: Proxy request
Type: String
Permission: Read

The complete list of query parameters in the request sent from the client app.

For example, if the request is

http://host.com/123?name=first&surname=second&place=address

then this variable returns

name=first&surname=second&place=address

request.transportid

Scope: Proxy request
Type: String
Permission: Read

ID of the request as type TransportMessage which is a contextual object

request.transport.message

Scope: Proxy request
Type: Transport Message
Permission: Read

Request of type TransportMessage which is a contexual object 

request.uri

Scope: Proxy request
Type: String
Permission: Read/Write

The value of the request.path variable including query parameters. 

request.verb

Scope: Proxy request
Type: String
Permission: Read/Write

The HTTP verb used for the request. For example: GET, PUT, DELETE

request.version

Scope: Proxy request
Type: String
Permission: Read

Gets the HTTP version of the request.

response.formstring

Scope: Target request
Type: String
Permission: Read

The complete list of form parameters in the request.

For example: name=test&type=first&group=A

route.target

Scope: Target request
Type: String
Permission: Read

The TargetEndpoint name. For example: default.

servicecallout.{policy-name}.expectedcn

Scope: Proxy request
Type: String
Permission: Read/Write

The expected Common Name of the TargetEndpoint as referred to in a ServiceCallout policy. This is meaningful only when the TargetEndpoint refers to an SSL endpoint.

servicecallout.{policy-name}.target.url

Scope: Proxy request
Type: String
Permission: Read/Write

The TargetEndpoint URL for a particular ServiceCallout policy. See also, Service Callout policy.

target.basepath

Scope: Target request
Type: String
Permission: Read

Returns basepath of TargetEndpoint

target.basepath.with.query

Scope: Target request
Type: String
Permission: Read

Returns basepath with queryparam of TargetEndpoint.

target.copy.pathsuffix

Scope: Target request
Type: Boolean
Permission: Read/Write

When true, request forwarded from ProxyEndpoint to TargetEndpoint retains path sufffix (the URI path fragment following the URI defined in the ProxyEndpoint base path.)

target.copy.queryparams

Scope: Target request
Type: Boolean
Permission: Read/Write

When true, request forwarded from ProxyEndpoint to TargetEndpoint retains query parameters.

target.cn

Scope: Target request
Type: String
Permission: Read

The Common Name of the TargetEndpoint. This is meaningful only when the TargetEndpoint refers to an SSL endpoint.

target.expectedcn

Scope: Proxy request
Type: String
Permission: Read/Write

The expected Common Name of the TargetEndpoint. This is meaningful only when the TargetEndpoint refers to an SSL endpoint.

target.host

Scope: Proxy request
Type: String
Permission: Read

Target host to which message is reaching from TargetEndpoint

target.name

Scope: Target request
Type: String
Permission: Read

Target to which message is reaching from targetendpoint

target.ip

Scope: Proxy request
Type: String
Permission: Read

Target ip to which message is reaching from targetendpoint

target.port

Scope: Proxy request
Type: Integer
Permission: Read

Target source port which is connected to TargetEndpoint port for receiving request.

targetserver.name

Scope: Target request
Type: String
Permission: Read

Target server name to which message is reaching from targetendpoint

target.scheme

Scope: Target request
Type: String
Permission: Read/Write

Returns http or https depending on the request message

target.sent.end.time

Scope: Target request
Type: String
Permission: Read

The time, expressed in string form, at which the proxy stopped sending the request to the URL specified in the TargetEndpoint. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

target.sent.end.timestamp

Scope: Target request
Type: Long
Permission: Read

The timestamp value specifying when the proxy finished sending the request to the URL specified in the TargetEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

target.sent.start.time

Scope: Target request
Type: String
Permission: Read

The time, expressed in string form, at which the proxy began sending the request to the URL specified in the TargetEndpoint. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

target.sent.start.timestamp

Scope: Target request
Type: Long
Permission: Read

The timestamp value specifying when the proxy started sending the request to the URL specified in the TargetEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

target.ssl.enabled

Scope: Proxy request
Type: Boolean
Permission: Read

Whether TargetEndpoint is running on SSL

target.url

Scope: Target request
Type: String
Permission: Read/Write

When read, returns the complete URL set in the TargetEndpoint, including any query parameters.  When written, sets the complete URL for the TargetEndpoint.

Use a JavaScript policy to set this variable.

variable.expectedcn

Scope: Proxy request
Type: String
Permission: Read/Write

Variable exposed for the common name if it's running on SSL

virtualhost.aliases

Scope: Proxy request
Type: String_array
Permission: Read

Host aliases of the virtual host that is hit during a particular request

virtualhost.name

Scope: Proxy request
Type: String
Permission: Read

Name of the virtual host that serves the originating client request

virtualhost.ssl.enabled

Scope: Proxy request
Type: Boolean
Permission: Read

Returns true if SSL is enabled in the virtual host configuration

Response message variables

Using the variables that apply to the response message, policies may access message components including the header, the query parameters, and form parameters, the source IP address, the HTTP message body, and so on.

The proxy receives a response message, then applies to it a series of policies, based on conditions evaluated on the response, which can modify or transform the response.

Policies can examine response variables, then transform or reject the request based on the content of those variables. Policies transform the response by setting the appropriate variables, for example variables corresponding to the response headers.

Response message variable Description
client.sent.end.time

Scope: Proxy response
Type: String
Permission: Read

The time, expressed in string form, at which the proxy finished sending the response from the ProxyEndpoint to the client. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

client.sent.end.timestamp

Scope: Proxy response
Type: Long
Permission: Read

The timestamp value specifying when the proxy finished sending the response to the client from the ProxyEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

client.sent.start.time

Scope: Proxy response
Type: String
Permission: Read

The time, expressed in string form, at which the proxy began sending the response from the ProxyEndpoint to the client. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

client.sent.start.timestamp

Scope: Proxy response
Type: Long
Permission: Read

The timestamp value specifying when the proxy began sending the response to the client from the ProxyEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

loadbalancing.failedservers

Scope: Target response
Type: String_array
Permission: Read

 

List of failed TargetServers during load balancing at TargetEndpoint
loadbalancing.isfallback

Scope: Target response
Type: Boolean
Permission: Read

Return true if fallback is enabled for the TargetServer invoked during load balancing at TargetEndpoint 

loadbalancing.targetserver

Scope: Target response
Type: String
Permission: Read

TargetServer invoked during load balancing at TargetEndpoint 

message.reason.phrase

Scope: Target response
Type: String
Permission: Read

ReasonPhrase of the response message from target

message.status.code

Scope: Target response
Type: Integer
Permission: Read

HTTP status code of the response message from target

response

Scope: Target response
Type: Message
Permission: Read/Write

Complete response message returned by target

response.content

Scope: Target response
Type: String
Permission: Read/Write

Payload content of the response message returned by the target

response.formparam.{formparam_name}

Scope: Target response
Type: String
Permission: Read/Write

The value of a form parameter in the response

response.formparam.{formparam_name}.values.count

Scope: Target response
Type: Integer
Permission: Read

Count of all the values of the specified form parameter in response

response.formparam.count

Scope: Target response
Type: Integer
Permission: Read

Count of all form prameters in the response

response.formparam.names

Scope: Target response
Type: Collection
Permission: Read

The names of all the form parameters in the response

response.header.{header_name}

Scope: Target response
Type: String
Permission: Read/Write

Gets or sets the value of a specified HTTP header in the response

response.header.{header_name}.values

Scope: Target response
Type: Collection
Permission: Read

All the values of a specified HTTP header in response

response.header.{header_name}.values.count

Scope: Target response
Type: Integer
Permission: Read

Count of all the values of the specified HTTP header in response

response.headers.count

Scope: Target response
Type: Integer
Permission: Read

Count of all the headers in the response

response.headers.names

Scope: Target response
Type: Collection
Permission: Read

The names of all the headers in the response

response.reason.phrase

Scope: Target response
Type: String
Permission: Read/Write

The response reason phrase for a particular request

response.status.code

Scope: Target response
Type: Integer
Permission: Read/Write

The response code returned for a particular request

response.transport.message

Scope: Target response
Type: String
Permission: Read

Response of type TransportMessage which is a contexual object 

target.country

Scope: Target response
Type: String
Permission: Read

Country of the SSL certificate presented by the target server

target.email.address

Scope: Target response
Type: String
Permission: Read

Email address of the SSL certificate presented by the target server

target.organization

Scope: Target response
Type: String
Permission: Read

Organization of the SSL certificate presented by the target server

target.organization.unit

Scope: Target response
Type: String
Permission: Read

Organization unit of the SSL certificate presented by the target server

target.locality

Scope: Target response
Type: String
Permission: Read

Locality (city) of the SSL certificate presented by the target server

target.received.end.time

Scope: Target response
Type: String
Permission: Read

The time, expressed in string form, at which the TargetEndpoint started receiving the response from the target. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

target.received.end.timestamp

Scope: Target response
Type: Long
Permission: Read

The timestamp value specifying when the TargetEndpoint finished receiving the response from the target. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

target.received.start.time

Scope: Target response
Type: String
Permission: Read

The time, expressed in string form, at which the TargetEndpoint finished receiving the response from the target. For example: Wed, 21 Aug 2013 19:16:47 UTC

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

target.received.start.timestamp

Scope: Target response
Type: Long
Permission: Read

The timestamp value specifying when the TargetEndpoint started receiving the response from the target. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

target.state       

Scope: Target response
Type: String
Permission: Read

State of the SSL certificate presented by the target server

Message variables

Message variables are contextual: they refer to different message types (request, response, or error) depending on the point within the API Proxy Flow in which they are called. The supported message variables are listed below.

Message variables Description 
error

Scope: Error
Type: Message
Permission: Read/Write

Error of type Message which is a contextual object in the error flow

error.content

Scope: Error
Type: String
Permission: Read/Write

Content of the error 

error.message

Scope: Error
Type: String
Permission: Read

Message associated with an error, whose value is available only before the error Flow is executed

error.transport.message

Scope: Error
Type: Transport_Message
Permission: Read

Any error of type TransportMessage 

error.state

Scope: Error
Type: Integer
Permission: Read

State in the Flow where an error occured

message

Scope: Always
Type: Message
Permission: Read/Write

A contextual object, with the same value as request in the request Flow or as response in the response Flow or as error in the Error flow.

message.content

Scope: Always
Type: String
Permission: Read/Write

Content of the request or response message

message.formparam.{formparam_name}

Scope: Always
Type: String
Permission: Read/Write

Value of the specified form parameter

message.formparam.{formparam_name}.values

Scope: Always
Type: Collection
Permission: Read

All values of the specified form parameter in the message

message.formparam.{formparam_name}.values.count

Scope: Always
Type: Integer
Permission: Read

Count of the values of the specified form parameters in the message

message.formparam.count

Scope: Always
Type: Integer
Permission: Read

Count of all form parameters in the message

message.formparam.names

Scope: Always
Type: Collection
Permission: Read

Value of all form parameters in the message

message.formstring

Scope: Always
Type: String
Permission: Read

Value of form string in the message

message.header.{header_name}

Scope: Always
Type: String
Permission: Read/Write

Gets or sets the value of the specified HTTP header in the message

message.header.{header_name}.values

Scope: Always
Type: Collection
Permission: Read

All values of the specified HTTP header name in the message

message.header.{header_name}.values.count

Scope: Always
Type: Integer
Permission: Read

Count of the values of the specified HTTP header name in the message

message.headers.count

Scope: Always
Type: Integer
Permission: Read

Count of all HTTP headers in the message

message.headers.names

Scope: Always
Type: Integer
Permission: Read

Value of all HTTP headers in the message

messagelogging.{policy-name}.failed

Scope: Always
Type: Boolean
Permission: Read

Failure flag for the referenced Message logging policy

messagelogging.failed

Scope:
Type:
Permission:

 

Failure flag for Message logging policy
message.queryparam.{queryparam_name}.values

Scope: Always
Type: Integer
Permission: Read

Value of the specified query parameter in the message

message.transport.message

Scope: Always
Type: Transport_Message
Permission: Read

Message of type TransportMessage which is a contextual object

Path variables

Path variables are predefined variables that can be used to retrieve different parts of the request path.

Variables Path Description
Request variables request.uri The HTTP request path, which includes a path and a query string separated by a question mark ( ? )
request.path The HTTP request path without the query string
request.querystring The portion of the HTTP request path after the question mark ( ? )
Application variables application.basepath The deployment base path (specified during API deployment)
Proxy Variables proxy.basepath The base path as configured in the proxy XML file
proxy.pathsuffix The portion of the request path after the proxy basepath
Target variables target.url The URL configured in the target XML file or the dynamic target URL (if target.url is set during the message flow)
target.basepath The path (without host or port) in the URL configured in the target XML file or the dynamic target URL (if target.url is set during the message flow)
target.basepath.with.query The path along with query params (without host or port) in the URL configured in the target XML file or the dynamic target URL (if target.url is set during the message flow)

Example

Consider the following deployment:

  1. Deployment path: /dev/
  2. Proxy base path: /twitter/
  3. Virtual host port: 8090
  4. Virtual host alias: mytwitter.com
  5. Target URL: http://api.twitter.com/1/

Request from client - The client makes the request:

            GET /dev/twitter/help/test.json
            curl http://{host}:8090/dev/twitter/help/test.json -H 'host: mytwitter.com'

The path is visualized as :

            {VERB} {proxy.basepath}/{proxy.pathsuffix}

Request is sent to target as:

            GET /1/help/test.json
            equivalent to:  curl http://api.twitter.com/1/help/test.json

The path is visualized as:

            {VERB} {target.basepath}/{proxy.pathsuffix}?{query params}

Usage in flows

Paths are usually used to classify requests as REST resources. This is achieved using conditional flows in a path match condition. Consider the following two requests based on the example above, which are two resources:

          GET /dev/twitter/help/test.json
          GET /dev/twitter/statuses/public_timeline.json

You can enforce different policies on these resources. The proxy.pathsuffix variable policy is recommended in conditions.

Note: You cannot use request.path because it includes the deployment path, which can change. The same bundle should work with different deployment paths.

Configuration variables

Configuration variables represent the configuration settings for an organization on Apigee Edge. The supported configuration variables are listed below.

Configuration variables Description
organization.name

Scope: Always
Type: String
Permission: Read

Name of the organization

environment.name

Scope: Always
Type: String
Permission: Read

Name of the environment

apiproxy.name

Scope: Always
Type: String
Permission: Read

Name of the apiproxy

apiproxy.revision

Scope: Always
Type: String
Permission: Read

The revision number of an API proxy

is.error

Scope: Always
Type: Boolean
Permission: Read

Error flag

proxy.basepath

Scope: Always
Type: String
Permission: Read

The base path (URI) configured for the ProxyEndpoint

proxy.name

Scope: Always
Type: String
Permission: Read

The name attribute configured for the ProxyEndpoint

proxy.pathsuffix

Scope: Always
Type: String
Permission: Read

The request URI path fragment following the URI base path URI fragment

System variables

System variables contain system-related information. A system variable is prefixed with _system. wherever it is referenced. The part of the variable that appears after the prefix specifies the function in the system, such as host name, date, time, and interfaces. The supported system variables are listed below.

System variable Description 
system.timestamp

Scope: Always
Type: Long
Permission: Read

The timestamp value specifying when the request is received from the client at the ProxyEndpoint. This value is a 64-bit (long) integer containing the number of milliseconds elapsed since midnight, on January 1, 1970 UTC.

system.time

Scope: Always
Type: String
Permission: Read

The time, expressed in string form, at which the proxy received a request from a client at the ProxyEndpoint. For example: Wed, 21 Aug 2013 19:16:47 UTC.

This time value is the string representation of the corresponding 32-bit timestamp quantity. For example, 'Wed, 21 Aug 2013 19:16:47 UTC' corresponds to the timestamp value of 1377112607413.

system.time.year

Scope: Always
Type: Integer
Permission: Read

The year portion of the system.time variable.

system.time.month

Scope: Always
Type: Integer
Permission: Read

The month portion of the system.time variable.

system.time.day

Scope: Always
Type: Integer
Permission: Read

The day of month portion of the system.time variable.

system.time.dayofweek

Scope: Always
Type: Integer
Permission: Read

The day of the week portion of the system.time variable.

system.time.hour

Scope: Always
Type: Integer
Permission: Read

The hour portion of the system.time variable.

system.time.minute

Scope: Always
Type: Integer
Permission: Read

The minute portion of the system.time variable.

system.time.second

Scope: Always
Type: Integer
Permission: Read

The second portion of the system.time variable.

system.time.millisecond

Scope: Always
Type: Integer
Permission: Read

The millisecond portion of the system.time variable.

system.time.zone

Scope: Always
Type: String
Permission: Read

Timezone of the system.

system.interface.{interface_name}

Scope: Always
Type: String
Permission: Read

IP Address of the system.

system.pod.name

Scope: Always
Type: String
Permission: Read

The name of the pod where the proxy is running.

system.region.name

Scope: Always
Type: String
Permission: Read

The name of the data center region where the proxy is running.

system.uuid

Scope: Always
Type: String
Permission: Read

The UUID of the message processor handling the proxy.

router.uuid

Scope: Always
Type: String
Permission: Read

The UUID of the router handling the proxy.

SSL/TLS variables

The following variables are populated when an API proxy executes a transaction over inbound SSL/TLS. For the variables to be populated the property propagate.additional.ssl.headers must set to true in the ProxyEndpoint configuration.

For example:

<ProxyEndpoint name="myProxy">
  <HTTPProxyConnection>
  <BasePath>/v1/weather</BasePath>
  <VirtualHost>secure</VirtualHost>
  <Properties>
    <Property name="propagate.additional.ssl.headers">true</Property>
  </Properties>
</HTTPProxyConnection>

The variables are designed to be at parity with the Apache web server SSL settings.

SSL variable Description
ssl.protocol

Scope: Proxy request
Permission: Read

The negotiated SSL protocol version (SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2).

ssl.session.id

Scope: Proxy request
Permission: Read

The hex-encoded SSL session id.

ssl.cipher

Scope: Proxy request
Permission: Read

The name of the negotiated cipher.

ssl.server.m.version

Scope: Proxy request
Permission: Read

The version of the server certificate.

ssl.server.m.serial

Scope: Proxy request
Permission: Read

The serial number of the server certificate.

ssl.server.i.dn

Scope: Proxy request
Permission: Read

The distinguished name of the server certificate's issuer.

ssl.server.i.dn.cn

Scope:
Permission:

 

The common name of the server certificate's issuer.
ssl.server.i.dn.c

Scope: Proxy request
Permission: Read

The country of the server certificate's issuer.

ssl.server.i.dn.o

Scope: Proxy request
Permission: Read

The organization of the server certificate's issuer.

ssl.server.i.dn.l

Scope: Proxy request
Permission: Read

The locality of the server certificate's issuer.

ssl.server.s.dn

Scope: Proxy request
Permission: Read

The distinguished name of the server certificate.

ssl.server.s.dn.cn

Scope: Proxy request
Permission: Read

The common name of the server certificate.

ssl.server.s.dn.c

Scope: Proxy request
Permission: Read

The country of the server certificate.

ssl.server.s.dn.o

Scope: Proxy request
Permission: Read

The organization of the server certificate.

ssl.server.s.dn.l

Scope: Proxy request
Permission: Read

The locality of the server certificate.

ssl.server.v.start

Scope: Proxy request
Permission: Read

Valid start time of the server certificate.

ssl.server.v.end

Scope: Proxy request
Permission: Read

Valid end time of the server certificate.

ssl.server.v.remain

Scope: Proxy request
Permission: Read

Number of days until server certificate expires.

ssl.server.a.sig

Scope: Proxy request
Permission: Read

Algorithm used for the signature of the server certificate.

ssl.server.a.key

Scope: Proxy request
Permission: Read

Algorithm used for the public key of the server certificate.

ssl.client.m.version

Scope: Proxy request
Permission: Read

The version of the client certificate.

ssl.client.m.serial

Scope: Proxy request
Permission: Read

The serial number of the client certificate.

ssl.client.i.dn

Scope: Proxy request
Permission: Read

The distinguished name of the client certificate's issuer.

ssl.client.i.dn.cn

Scope: Proxy request
Permission: Read

The common name of the client certificate's issuer.

ssl.client.i.dn.c

Scope: Proxy request
Permission: Read

The country of the client certificate's issuer.

ssl.client.i.dn.o

Scope: Proxy request
Permission: Read

The organization of the client certificate's issuer.

ssl.client.i.dn.l

Scope: Proxy request
Permission: Read

The locality of the client certificate's issuer.

ssl.client.s.dn

Scope: Proxy request
Permission: Read

The distinguished name of the client certificate.

ssl.client.s.dn.cn

Scope: Proxy request
Permission: Read

The common name of the client certificate.

ssl.client.s.dn.c

Scope: Proxy request
Permission: Read

The country of the client certificate.

ssl.client.s.dn.o

Scope: Proxy request
Permission: Read

The organization of the client certificate.

ssl.client.s.dn.l

Scope: Proxy request
Permission: Read

The locality of the client certificate.

ssl.client.v.start

Scope: Proxy request
Permission: Read

Valid start time of the client certificate.

ssl.client.v.end

Scope: Proxy request
Permission: Read

Valid end time of the client certificate.

ssl.client.v.remain

Scope: Proxy request
Permission: Read

Number of days until client certificate expires.

ssl.client.a.sig

Scope: Proxy request
Permission: Read

Algorithm used for the signature of the client certificate.

ssl.client.a.key

Scope: Proxy request
Permission: Read

Algorithm used for the public key of the client certificate.

Variables for API proxy flows

The following variables contain information about API proxy flows.

To see these variables in the API proxy editor's Trace view (in the Edge management UI), select the "Show All FlowInfos" view option.

Variable Description
current.flow.name

Scope: Proxy request
Type: String
Permission: Read

The name of the currently executed flow (such as "PreFlow", "PostFlow", or the name of a conditional flow).

current.flow.description

Scope: Proxy request
Type: String
Permission: Read

The description (<Description> element value) of the currently executed flow.

proxy.flow.name

Scope: Proxy request
Type: String
Permission: Read

The name of the most recently executed ProxyEndpoint flow (such as "PreFlow", "PostFlow", or the name of a conditional flow).

proxy.flow.description

Scope: Proxy request
Type: String
Permission: Read

The description (<Description> element value) of the most recently executed ProxyEndpoint flow.

target.flow.name

Scope: Target request
Type: String
Permission: Read

The name of the most recently executed TargetEndpoint flow (such as "PreFlow", "PostFlow", or the name of a conditional flow).

target.flow.description

Scope: Target request
Type: String
Permission: Read

The description (<Description> element value) of the most recently executed TargetEndpoint flow.

Policy variables

Each Policy type defines a set of policy-specific variables. For details, see each Policy type under the Policy reference overview.

Help or comments?

  • If something's not working: Ask the Apigee Community or see Apigee Support.
  • If something's wrong with the docs: Click Send Docs Feedback on this page.
    (Incorrect? Unclear? Broken link? Typo?)