MuleSoft Composer is a no-code integration platform that enables users to integrate data and apps easily. The process starts by building flows using various pre-built connectors, including Salesforce, Workday, Slack, MuleSoft RPA, and others.MuleSoft has recently launched the API Sharing for Anypoint Platform, enabling the collaboration between IT and business users through MuleSoft Composer and Anypoint Platform. It is achieved by sharing externally available APIs managed in Anypoint that are not currently supported through dedicated connectors.
Some of the benefits of API Sharing:
-
Composer business users can easily and quickly discover and request access to APIs available in Anypoint Exchange.
-
Easy to integrate Composer, Anypoint Platform APIs, and MuleSoft RPA. With that in mind, you can unlock data and connect apps and automate work across legacy systems and modern applications (RPA).
-
Business users do not have to worry about the integration complexity between the backend systems and their data transformation (Dataweave).
To demonstrate the benefits of API Sharing, I created an API to connect to Breathe HR (our cloud-based HR platform to fetch information about employees), deployed it to CloudHub, and shared it with Composer.
API sharing
Composer's HTTP connector vs Rest Consumer Connector
In the previous blog series - Order cupcakes using MuleSoft Composer and the RPA bot, Mayara Oliveira Silva and Olga Kepa used the out-of-the-box HTTP Connector to connect to Breathe HR.
MuleSoft Composer's HTTP Connector
Today, I show you how to replace that HTTP Connector with your Rest Consumer Connector (Anypoint Platform Shared API). Follow the steps:
-
Share an API Instance with Composer by publishing the API specification (RAML or OpenAPI) to Exchange.
API specification
-
Build a Mule Application that connects to the backend system (in my case, I built an API to connect to Breathe HR); deploy it to CloudHub, and manage it with Anypoint API Manager.
-
Connect Composer to Anypoint Platform.
-
Request Access to the API.
Once the access is granted by IT, these APIs will be available out-of-the-box as a Rest Consumer Connector to consume these APIs in Composer flows like any other connector. -
Add the Composer Rest Consumer Connector into Composer flows.
The image below shows the Rest Consumer Connector (Breathe HR) in Composer Flow shared by Anypoint Platform.
Connect Composer to Anypoint Platform
-
Using administrator credentials, log in MuleSoft Composer and click Settings > Account.
-
Copy the value in the Organization ID field.
-
Log in to the Anypoint Platform and open the Access Management page and click Composer Sync.
-
Click on Add Composer Organization button, and in the Organization ID field, paste the Organization ID (from MuleSoft Composer) that you copied and then click Add.
-
Go to MuleSoft Composer and refresh the page and click Settings > Account.
The Account page appears, displaying a linking request from Anypoint Platform. -
Click Review and Confirm.
-
In the Access Token section, click Authenticate in Anypoint.
-
Log in to Anypoint Platform.
-
In the Client App section, click Create Client App. The Composer is linked to the Anypoint organization.
For more information, refer to Connect Composer to Anypoint Platform.
Composer linked to the Anypoint Platform.
Anypoint Platform Linked to Composer.
The Composer application is created and visible on the Exchange page.
Composer Application
Share an API Instance with Composer
To share an API Instance with a MuleSoft Composer business user for consumption, your API must be:
-
Managed with Anypoint API Manager
-
The API specifications use either RAML or OpenAPI.
-
The API uses basic authentication, bearer token, or API Key in conjunction with a Client ID and Secret.
-
The API has a value for the Consumer Endpoint field in API Manager.
-
-
The API must be accessible from the public internet.
For more information, refer to API Sharing.
Request Access
Once the API specification is published on Exchange, you need to Request Access using the Composer Application recently created by following the steps below:
-
In Anypoint Platform, click Exchange and search for the API that you want to share with Composer.
-
Click Request access, and then select Composer and click Request access.
Request Access
Connect to a System
The next step is to replace the MuleSoft Composer HTTP Connector with the Rest Consumer Connector (Shared API) by following the steps below:
-
Add a new step and click System Action
-
Select the Shared API (Rest Consumer Connector)
-
Create a connection with your API by providing a Connection Display Name, and click Next.
-
Enter the Request Path and click Connect.
-
In Action, select Request and Operation, the endpoint that you want to call.
-
Add the example of the response by clicking on Add Override Sample Output.
The demonstration below shows how I replaced the MuleSoft Composer HTTP Connector with the Anypoint Platform Shared API (Rest Consumer Connector).
Conclusion
MuleSoft makes it simple for Composer users to increase the speed of automating business processes by sharing the reusable Assets published and managed in the Anypoint Platform to integrate data from anywhere.
I hope you found this post useful.
References