Create Your First Integration as an API¶
An integration component integrates APIs, microservices, applications implemented in different languages, and data in different formats.
Consider a scenario where a developer needs to use an existing integration that was created using the WSO2 Integration Studio and expose it as an API in Choreo. In this tutorial, you will learn how to do the following actions to address this requirement:
- Expose an integration created in WSO2 Integration Studio as an API in Choreo by connecting the GitHub repository in which it resides to Choreo.
- Deploy the Integration component to the development environment.
- Test the Integration component.
- Observe statistics for the Integration component.
- Publish the Integration component and try it out in the production environment.
For this tutorial, let's use a basic sample application to expose a proxy service developed in the WSO2 Integration Studio.
Before you begin!
To try this tutorial, you can use a sample integration designed via WSO2 Integration Studio.
To do this, fork the choreo-examples GitHub repository.
Step 1: Create¶
Let's add the integration by following the steps given below:
Sign in to the Choreo Console at https://console.choreo.dev/.
On the Home page, click on the project in which you want to create the integration. Alternatively, you can click + Create Project and add a new project.
If your project has one or more components, click + Create. If not, proceed to the next step.
On the Integration as an API card, click Create to start creating a micro integrator REST API.
Enter a name and a description for the micro integrator REST API. For example, you can enter
MI Hello Worldas the name and
MI Hello World REST APIas the description.
To the micro integrator REST API as a publicly accessible API, leave the selection in the Access Mode list unchanged.
Authorize Choreo to connect to your GitHub account by clicking Authorize with GitHub.
If you have not already authorized Choreo applications, click Authorize Choreo Apps when prompted.
Enter information related to the GitHub repository you want to connect as follows:
Field Value GitHub Account Select your GitHub account. GitHub Repository Select your fork of the choreo-examples GitHub repository. Branch
Under Build Preset, click Micro Integrator.
!!! info The build preset specifies the type of build that Choreo needs to run for the component (for example, Choreo needs to run a micro integrator build for components developed via the WSO2 Integration Studio, a Ballerina build for a component added via a Ballerina project, etc.,).
Enter information related to the
MI Hello Worldproject as follows:
Field Value Path
OpenAPI File Path
The micro integrator REST API opens on a separate page.
Step 2: Deploy¶
Let's deploy the micro integrator REST API you created to the developer environment by following the steps given below:
In the left navigation menu, click Deploy.
Click Deploy Manually.
Automatic deployment is enabled for the component by default. You are required to carry out only the first deployment manually.
Once Choreo has deployed the micro integrator REST API, you can proceed to the next step to test it.
Step 3: Test¶
Once you have deployed the integration REST API you can test it via the OpenAPI Console, or a cURL command.
In this tutorial, let's test via the OpenAPI Console:
To open the test view, click Test in the Development card. Alternatively, you can click the Test icon in the left panel.
Click OpenAPI Console.
Select /HelloWorld resource and click Try it out.
Click Execute. Choreo displays the following response in Response body.
The above response indicates that your micro integrator REST API is working as expected.
Step 4: Observe¶
To observe statistics for your micro integrator REST API, click Observe in the left navigation menu. The graphs for throughput and latency will display the request you sent in Step 3: Test.
For more information about observing components, see Observability Overview.
Step 5: Publish¶
Let's publish the micro integrator REST API to make it available for subscriptions in the Developer Portal.
In the left navigation menu, click Manage, and then click Lifecycle.
The lifecycle status of the API will change to Published.
To view the API in the Developer Portal, click Go to Devportal. The API opens on a separate page in the Developer Portal.
Congratulations! You have successfully exposed an integration designed in the WSO2 Integration Studio as a REST API in Choreo and published it!
For a micro integrator REST API, you can also perform API management actions. For more information about these API Management actions, see API Management.