Develop an Integration with Integration Studio¶
The seamless integration of APIs, microservices, applications, and data across different languages and formats requires the ability to expose integrations as APIs. Choreo iPaaS simplifies building, deploying, and managing integration components, making it easy for you to quickly expose integrations as APIs.
This guide walks you through the steps to expose an integration you created in WSO2 Integration Studio as an API in Choreo.
In this guide, you will:
- Create a component to expose the sample integration in the Choreo examples repository as an API.
- Deploy, test, and observe the integration component.
- Publish the integration component as an API to the Choreo Developer Portal.
Before you try out the steps in this guide, complete the following:
If you are signing in to the Choreo Console for the first time, create an organization as follows:
- Go to https://console.choreo.dev/, and sign in using your Google, GitHub, or Microsoft account.
- Enter a unique organization name. For example,
- Click Create. This creates the organization and opens the Project Home page of the default project created for you.
Fork the Choreo examples repository, which contains the sample integration for this guide.
- Download and install WSO2 Integration Studio locally.
Step 1: Create the integration component¶
- Sign in to Choreo iPaaS. This opens the Project Home page in the Choreo Console.
- If you already have one or more components in your project, click + Create. Otherwise, proceed to the next step.
- Go to the Integration as an API card and click Create.
Enter a unique name and a description for the component. You can enter the name and description given below:
Field Value Name
Hello World REST API
Select External as the Access Mode, and click Next.
- To allow Choreo to connect to your GitHub account, click Authorize with GitHub.
If you have not already connected your GitHub repository to Choreo, enter your GitHub credentials, and select the repository you created in the prerequisites section to install the Choreo GitHub App.
The Choreo GitHub App requires the following permissions:
- Read and write access to code and pull requests.
- Read access to issues and metadata.
You can revoke access if you do not want Choreo to have access to your GitHub account. However, write access is only used to send pull requests to a user repository. Choreo will not directly push any changes to a repository.
In the Connect Repository pane, enter the following information:
Field Description GitHub Account Your account GitHub Repository The repository you created by following the steps in the prerequisites section Branch
Build Preset Click WSO2 MI because you are creating the REST API from a WSO2 Integration Studio project Access Mode To make the REST API publicly accessible, leave the selection unchanged as External. Project Path
OpenAPI File Path
Click Create. Choreo initializes the component with the sample integration.
Step 2: Deploy the integration component¶
To deploy the integration component to the development environment, follow the steps given below:
- In the Choreo Console left navigation menu, click Deploy.
- In the Build Area card, click Configure & Deploy.
In the Configure & Deploy pane, click Deploy. The Development card indicates the Deployment Status as Active when the integration is successfully deployed.
Automatic deployment is enabled for the component by default. Therefore, you are required to perform only the first deployment manually.
Now you can test the integration.
Step 3: Test the integration¶
Choreo allows you to test your integration using either the integrated OpenAPI Console, cURL, or Postman.
In this guide, you will test the integration using the OpenAPI Console. Follow the steps given below:
- For instructions on how to test using cURL, see Test with cURL.
- For instructions on how to test using Postman, see Test with Postman.
- In the Choreo Console left navigation menu, click Test.
- In the OpenAPI Console pane that opens, select Development from the environment drop-down list.
- Click to expand the GET /HelloWorld operation.
- Click Try it out and then click Execute. This sends a request to your deployed integration.
Go to the Response body section and observe the response returned by the integration. If the integration works as expected, you should see a response similar to the following:
Step 4: Observe the integration¶
The observability view in Choreo displays graphs that depict details such as throughput, latency, diagnostic data, and logs to identify and troubleshoot anomalies in components you deploy.
To visualize and monitor the performance of the integration component you deployed, click Observe in the left navigation menu. You can observe the following:
- The throughput and latencies of requests served over a given period.
- The logs that are generated over a given period.
- The flame graph (Diagnostics View) that is generated over a given period.
To learn more about the observability details you can view via Choreo observability, see Observability Overview.
Step 5: Publish the integration component¶
To publish the integration component, follow the steps given below:
- In the Choreo Console left navigation menu, click Manage and then click Lifecycle. This opens the Lifecycle Management pane, where you can see the different lifecycle stages that an API can be in. You can see that the current lifecycle stage is Created.
- In the Lifecycle Management pane, click Publish. This changes the API lifecycle stage to Published and exposes the integration as an API in the Choreo Developer Portal.
To open the published API in the Developer Portal via the Lifecycle Management pane, click Go to Devportal. In the Choreo Developer Portal, you can view the published API, manage subscriptions for it, and generate access tokens for testing purposes.
Now, you have gained hands-on experience in exposing an integration designed using WSO2 Integration Studio as a REST API in Choreo.