Software AG Products 10.5 | Using API Gateway | Usage Scenarios | Custom Policy Extension | How Do I Invoke a Service through HTTP/HTTPS using Custom Extension?
 
How Do I Invoke a Service through HTTP/HTTPS using Custom Extension?
This use case explains how to invoke a service through HTTP/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/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. Select External endpoint in the custom extension Type field.
8. 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.
9. Configure the custom properties of the custom extension as required.
For details about the custom extension properties and their descriptions, see Custom Extension Properties.
10. Click Save.
The API is saved with the added custom extension.
11. Invoke the API.
The applied custom extension invokes the mentioned HTTP/HTTPS endpoint and processes as configured.