Create and Publish an API with Sequence as a Backend¶
When using a sequence as a backend, you can execute any mediation logic which acts as a backend to the REST API. WSO2 API Manager has integrated the support for invoking REST API with custom mediation logic through WSO2 API Gateway. Follow the steps below to create and publish an API with Sequence as a Backend.
Step 1 - Create a REST API¶
-
Sign in to the API Publisher Portal
https://<hostname>:9443/publisher
. -
Click CREATE API and then click Start From Scrach.
-
Enter the API details without an endpoint URL and click Create.
Step 2 - Add Sequence Backend Endpoint¶
-
Click Endpoints to navigate to Endpoints page.
-
Navigate to the Sequence Backend Endpoint type and click ADD.
-
Upload a sequence file to the preferred Key Type
To upload, you can hit Add button under the selected key type. Sequence Backend endpoint configuration needs to have atleast one sequence for the API (either SANDBOX or PRODUCTION).
Note
In both key types, only one sequence is allowed to be added. If a developer wants to replace, then the uploaded one should be deleted from the preferred key type.
-
This lists the uploaded sequences for the preferred key types.
-
Download sequence uploaded of the preferred key type. This will download the sequence uploaded by the user.
-
Delete sequence uploaded from the preferred key type If there's only one item to be deleted, you will not be permitted to perform the operation as atleast one sequence should be provided under the "Sequence Backend" endpoint type.
-
Click Save.
Note
Button will not be enabled if there's no sequence provided under the Sequence Backend endpoint configuration.
Note
Sequence Backend endpoint type only applicable for REST APIs and can be deployed only in Synapse Gateway.