API Gateway 10.11 | Using API Gateway | Usage Scenarios | Custom Policy Extension | How Do I Invoke an API through HTTP or HTTPS using Custom Extension?
 
How Do I Invoke an API through HTTP or HTTPS using Custom Extension?
This use case explains how to invoke a service through HTTP or HTTPS using custom extension. The custom extension configured can be enforced in any of the policy stages and used during API processing.
The use case starts when you have an API that has to be enforced with a custom extension and ends when you successfully invoke the API with the custom extension enforced.
*To invoke a service through HTTP or HTTPS using custom extension
1. Ensure you have the external endpoint URL to be invoked during API processing using a custom extension.
2. Click APIs on the title navigation bar.
3. Click the required API.
The API details page appears.
4. Click Edit.
5. Select Policies.
6. Click Required Policy stage > Custom Extension.
This adds the custom extension policy where you can configure the required properties.
Click to open the policy properties section in a full page.
7. Provide the following information in the Conditions section, as required:
Property
Description
Condition
Conditions are used to specify when the policy has to be executed. You can add multiple conditions with logical operators.
Available values are:
*AND. API Gateway executes this policy when all the configured conditions comply in the respective policy stage
*OR. This is selected by default. API Gateway executes this policy when any one of the configured conditions complies.
Click Add Condition and provide the following information and click Add .
*Variable. Specifies the variable type with a syntax.
*Operator. Specifies the operator to use to relate variable and the value. You can select one of the following:
*Equals
*Equals ignore case
*Not equals
*Not equals ignore case
*Contains
*Exists
*Range
*Greater Than
*Less Than
*Value. Specifies a plain value or value with a syntax.
For details about the variables available in API Gateway, see Variables Available in API Gateway.
8. Click Custom Action.
9. Select External endpoint in the custom extension Type field.
10. Provide the following information in the External Endpoint section, as required:
Property
Description
Endpoint URI
Provide the external endpoint URI that you want to invoke.
Method
Specify the method exposed by the API.
Available values are: PUT, POST, GET, DELETE, HEAD, CUSTOM.
Note:
If you select CUSTOM, the HTTP method in the incoming request is sent to the native API.
SSL Configuration
Specifies the required SSL configuration details of the external endpoint.
Provide the following information:
*Keystore Alias. Specifies the keystore alias. For details on Keystore configuration, see Keystore and Truststore.
*Key Alias. Specifies the alias for the private key, which must be stored in the keystore specified by the keystore alias.
*Truststore Alias. Specifies the alias for the truststore. For details on Truststore configuration, see Keystore and Truststore.
*HTTP Connection Timeout (seconds). Specifies the time interval (in seconds) after which a connection attempt to the external endpoint URL times out.
*Read Timeout (seconds). Specifies the time interval (in seconds) after which a socket read attempt times out.
Path Parameters
Specifies the path parameter you want to configure to your custom extension.
Provide the following information:
*Path Parameter Name. Species the name of the path parameter you want to configure in your custom extension. This path parameter name should be present in the endpoint URL enclosed with {} to be replaced at runtime. For example, define external URL as http://host/authors/{id}/books and provide id as path parameter name with the value you need to populate at runtime.
*Path Parameter Value. Specifies the value for the path parameter specified.
11. Configure the custom properties of the custom extension as required.
For details about the custom extension properties and their descriptions, see Custom Extension Properties.
12. Click Save.
The API is saved with the added custom extension.
13. Invoke the API.
The applied custom extension invokes the mentioned HTTP or HTTPS endpoint and processes as configured.