Data objects and variables
The following table summarizes the data objects and variables that are available in API Gateway:
| Object/Variable type | Possible values |
|---|---|
paramStage |
|
paramType |
|
queryType |
|
The following data objects are available in the request processing or response processing steps:
${paramStage.paramType}You can use this syntax to access the following string variables:path,statusCode,statusMessage,httpMethod. Examples:${request.path},${response.statusCode}.${paramStage.paramType.paramName}You can use this syntax to access map types, such as query, headers, and path. Example:${request.query.var1},${response.header.Content-Type},${request.path.name}.${paramStage.paramType.queryType[queryValue]}This syntax can be used to query a paramType. Examples:${request.payload.xpath[//ns:emp/ns:empName]}Where "//ns:emp/ns:empName" is the XPath to be applied on the payload if contentType is application/xml, text/xml, or text/html.${response.payload.jsonPath[$.cardDetails.number]}Where$.cardDetails.numberis the jsonPath to be applied on payload if contentType is application/json or application/json/badgerfish.${request.payload.regex[[0-9]+]}Where[0-9]+is the regular expression to be applied on the payload if contentType is text/plain.
Note: WhilexpathandjsonPathare applicable only to payload,regExcan be used with bothpayloadandpath.${paramStage[stepName].paramType.paramName]}You can use this syntax to access header or payload from the response of the custom extension in the response processing step.Example: Variable:
${response.headers.id}Value:${response[customExtension].payload.jsonPath[$.id]}This transformation adds a header to the response with name id and its value is derived from the json payload that is sent from the external callout as per the json path.- You can define your own variables in the Transformation variables field in the response
processing step. Example:
${key},${value}. The custom transformation variables that you define are available in subsequent steps.