Variable Definition
Overview
Variable is a structure used for finding the data that the policy needs from the message in the API traffic. It is used to extract data from different parts of HTTP requests (header, parameter, body, etc.). See Variable
Key Features
Feature | Type | Required | Description |
---|---|---|---|
name | String | Yes | Unique name of the variable |
description | String | No | Description for the variable |
type | EnumVariableType | Yes | Type of variable (HEADER, PARAMETER, BODY, CONTEXT_VALUES, CUSTOM) |
Variable Types and Required Fields
type Value | Purpose of Use | Field | Description | Required |
---|---|---|---|---|
HEADER | Used to extract data from the header | headerName | The name of the Http Header field in the request or response message | Yes |
BODY | Used to extract data from the request/response body | targetContentType | Content type (XML, JSON, ALL_BODY) | Yes |
CONTEXT_VALUES | Used to extract data from system context values | contextValue | Context value type | Yes |
PARAMETER | Used to extract data from URL parameters | paramType | Parameter type (QUERY, PATH) | Yes |
paramName | Name of the path parameter in the request message | Yes | ||
paramPath | Template path to use for the “path” parameter in the request message | Required if paramType=PATH | ||
xpathValue | XPath expression for XML in the body data in the request or response message | Required for XML | ||
jsonPathValue | JsonPath expression for JSON in the body data in the request or response message | Required for JSON | ||
zoneId | Time zone | Required for some context values |
contextValue Values
Request Related Values
Context Value | Description |
---|---|
REQUEST_REMOTE_ADDRESS | IP address of the client |
REQUEST_HTTP_METHOD | HTTP method (GET, POST, etc.) |
REQUEST_CONTENT_TYPE | Request content type |
REQUEST_PATH_INFO | Request path information |
REQUEST_CONTEXT_PATH | Context path information |
REQUEST_QUERY_STRING | URL query string parameters |
REQUEST_REMOTE_USER | Remote user information |
REQUEST_USERNAME_KEY | Username or key |
REQUEST_REQUESTED_SESSION_ID | Session ID |
REQUEST_REQUEST_URI | Request URI |
REQUEST_CHARACTER_ENCODING | Character encoding |
REQUEST_CHARSET | Charset information |
REQUEST_CONTENT_LENGTH | Content length |
REQUEST_PROTOCOL | Protocol used |
REQUEST_SCHEME | Protocol scheme (http, https) |
REQUEST_SERVER_NAME | Server name |
REQUEST_SERVER_PORT | Server port number |
REQUEST_REMOTE_HOST | Remote host information |
REQUEST_REMOTE_PORT | Remote port number |
REQUEST_LOCAL_NAME | Local server name |
REQUEST_LOCAL_ADDR | Local IP address |
REQUEST_LOCAL_PORT | Local port number |
REQUEST_XFORWARDED_FOR | X-Forwarded-For header value |
Request Status Information
Context Value | Description |
---|---|
REQUEST_IS_SOAP_TO_REST | SOAP to REST transformation status |
REQUEST_IS_APIPROXY | API Proxy control |
REQUEST_IS_APIPROXYGROUP | API Proxy Group control |
REQUEST_IS_XWWW_FORM_URL_ENCODED | Form URL encoded format check |
REQUEST_IS_FORM_DATA | Form data format control |
REQUEST_IS_BYTE_ARRAY | Byte array format check |
REQUEST_HAS_ATTACHMENT | Additional file check |
REQUEST_GZIP | GZIP compression status |
REQUEST_DEFLATE | DEFLATE compression state |
REQUEST_HTTP_SERVLET | HTTP Servlet information |
Response Related Values
Context Value | Description |
---|---|
RESPONSE_IS_BYTE_ARRAY | Whether the response is in byte array format |
RESPONSE_GZIP | GZIP compression status |
RESPONSE_DEFLATE | DEFLATE compression state |
RESPONSE_BR | Brotli compression state |
RESPONSE_STATUS_CODE | HTTP status code |
RESPONSE_HTTP_SERVLET | HTTP Servlet information |
Message Related Values
Context Value | Description |
---|---|
MESSAGE_CORRELATION_ID | Message correlation ID |
Environment Related Values
Context Value | Açıklama |
---|---|
ENVIRONMENT_ID | Environment ID |
ENVIRONMENT_NAME | Environment Name |
ENVIRONMENT_CERTIFICATE | Certificate map |
ENVIRONMENT_PRIVATEKEY | Custom key map |
ENVIRONMENT_PUBLICKEY | Public key map |
ENVIRONMENT_SECRETKEY | Secret key map |
ENVIRONMENT_KEYSTORE | Keystore map |
ENVIRONMENT_JWK | JWK map |
API Proxy Group/Proxy/Method Values
Context Value | Description |
---|---|
APIPROXYGROUP_ID | API Proxy Group ID |
APIPROXYGROUP_NAME | API Proxy Group name |
APIPROXY_ID | API Proxy Group ID |
APIPROXY_NAME | API Proxy Group name |
APIMETHOD_ID | API Proxy Group ID |
APIMETHOD_NAME | API Proxy Group name |
APIMETHOD_SOAP_ACTION | SOAP action value |
APIMETHOD_HTTPMETHOD | HTTP method |
APIMETHOD_ENDPOINT | Endpoint information |
APIMETHOD_BACKEND_HTTPMETHOD | Backend HTTP method |
APIMETHOD_BACKEND_ENDPOINT | Backend endpoint information |
Values Related to History/Time
Context Value | Description |
---|---|
DATETIME_YEAR | Year |
DATETIME_MONTH | Month |
DATETIME_DAY_OF_WEEK | Day of the week |
DATETIME_DAY_OF_MONTH | Day of the month |
DATETIME_HOUR | Hour |
DATETIME_MINUTE | Minute |
DATETIME_SECOND | Seconda |
DATETIME_EPOCH_MILLIS | Epoch millisecond |
DATETIME_FORMATTED_TEXT | Formatted date-time |
DATE_FORMATTED_TEXT | Formatted date |
TIME_FORMATTED_TEXT | Formatted hour |
Identity Information
Context Value | Description |
---|---|
CREDENTIAL_USERNAME | Username |
CREDENTIAL_EMAIL | Email address |
CREDENTIAL_FULLNAME | Full name |
CREDENTIAL_SECRETKEY | Secret key |
CREDENTIAL_CERTIFICATE | Certificate |
CREDENTIAL_PUBLICKEY | Public key |
CREDENTIAL_PRIVATEKEY | Private key |
CREDENTIAL_KEYSTORE | Keystore |
CREDENTIAL_TRUSTSTORE | Truststore |
CREDENTIAL_JWK_SIGNANDVALIDATION | JWK for signing and verification |
CREDENTIAL_JWK_ENCRYPTIONANDDECRYPTION | JWK for encryption and decryption |
Example JSON Structures
1. Header Value
|
2. Query Parameter Variable
|
3. Path Parameter Variable
|
4. XML Body Variable
|
5. JSON Body Variable
|
6. Context Variable
|