API Gateway 10.5 | Using API Gateway | Usage Scenarios | Custom Policy Extension | Custom Extension Properties
 
Custom Extension Properties
The table lists the properties that you can specify for a custom extension.
Request Processing Section
The table lists the custom extension properties you can configure in the Request processing section:
Property
Description
Payload
Provide the request payload to be sent to the custom extension in one of the following ways:
*Type the request payload in the text box.
For details on the data objects and variables available in the Request Processing section that you can use to configure, see Data Objects and Variables Available in API Gateway.
*Click and select one of the following and provide the required information:
*Inline Request. Type the required payload.
*Load from Schema. Click Browse to upload a JSON or XML schema file and click Save.
Headers
Provide the following information, if you want to configure the headers you need to send to the custom extension. By default, no headers are sent to the custom extension.
*Select Use incoming headers to use the header content in the incoming requests from the client.
*Provide the Header Name and the Header Value in the incoming client request that has to be processed.
Query Parameters
Provide the following information, if you want to configure query parameters you need to send to the custom extension.
*Provide the Query Parameter Name and the Query Parameter Value in the incoming client request that has to be processed.
For details on the data objects and variables available in the Request Processing section that you can use to configure, see Data Objects and Variables Available in API Gateway.
Response Processing section
The table lists the custom extension properties you can configure in the Response processing section:
Property
Description
Copy the entire response
Select to copy the entire response received from the external call out.
This response is used in the subsequent step by using ${request.payload} or ${response.payload}.
Note:
Do not select this if you are using AWS Lambda custom extension with invocation type as Event as there is no response returned.
Abort API execution in case of failure
Select to abort the API execution when the external callout encounters any failures.
If you do not select this option, API Gateway logs the failure and continues with the processing.
Transformation
Specify the following custom variables with a syntax to be accessed from the response of the custom extension and click Add.
*Variable. Specifies the variable type with a syntax.
*Value. Specifies a value with a syntax.
Example 1
For example if you provide a variable as ${var} and the corresponding value as ${response[customExtension].payload.jsonPath[$.id]}, this transformation evaluates the JSON path from the custom policy response payload to get the value of the attribute id. The evaluated value is assigned to the variable var given in the Variable field. You can use the ${var} syntax in the subsequent custom extension.
Example 2
If you have a Request payload - {"EmpName":"Emp1","EmpNum":"EmpId"}, and
Response payload from Custom Extension external endpoint - {"EmpId":"50001"}
To transform the payload as {"EmpName":"Emp1","EmpNum":"50001"}, you can use a JSON path parameter, and provide the Variable and Value as follows:
Variable - ${request.payload.jsonPath[$.EmpNum]}
Value - ${response[customExtension].payload.jsonPath[$.EmpId]}
This fetches the value 50001 from the response of the external endpoint and replace the value EmpId in the existing payload.
For details about the data objects and variables available in the Response Processing section that you can use to configure, see Data Objects and Variables Available in API Gateway.
Custom extension metadata
This is used for XML transformation.
*Namespace Prefix. Provide the namespace prefix of the payload expression to be validated.
*Namespace URI. Provide the namespace URI of the payload expression to be validated.
Custom Extension Metadata section
The table lists the custom extension properties you can configure in the Custom Extension Metadata section. This is applicable only for XML transformation.
Property
Description
Namespace Prefix
Provide the namespace prefix of the payload expression to be validated.
Namespace URI
Provide the namespace URI of the payload expression to be validated.
For details about the data objects and variables that you can use to configure, see Data Objects and Variables Available in API Gateway.