Tech

MuleSoft Anypoint Platform: API Sharing for Composer and RPA

Photo of Leonardo Cassimiro Written by Leonardo Cassimiro,   Mar 10, 2023

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.

MuleSoft API sharingAPI 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 HTTP connectorMuleSoft 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:

  1. Share an API Instance with Composer by publishing the API specification (RAML or OpenAPI) to Exchange.

    API spec

    API specification

  2. 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.

  3. Connect Composer to Anypoint Platform.

  4. 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.

  5. 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.

Rest Consumer Connector in Composer Flow

 

Connect Composer to Anypoint Platform

  1. Using administrator credentials, log in MuleSoft Composer and click Settings > Account.

  2. Copy the value in the Organization ID field.

  3. Log in to the Anypoint Platform and open the Access Management page and click Composer Sync.

  4. 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.

  5. Go to MuleSoft Composer and refresh the page and click Settings > Account.
    The Account page appears, displaying a linking request from Anypoint Platform.

  6. Click Review and Confirm.

  7. In the Access Token section, click Authenticate in Anypoint.

  8. Log in to Anypoint Platform.

  9. 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

Composer linked to the Anypoint Platform.

Anypoint Platform Linked to Composer

Anypoint Platform Linked to Composer.

The Composer application is created and visible on the Exchange page.

Composer ApplicationComposer 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:

  1. In Anypoint Platform, click Exchange and search for the API that you want to share with Composer.

  2. Click Request access, and then select Composer and click Request access.

    Request AccessRequest 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:

  1. Add a new step and click System Action

    system action

  2. Select the Shared API (Rest Consumer Connector)

    Select the Shared API

  3. Create a connection with your API by providing a Connection Display Name, and click Next.

    Create a connection

  4. Enter the Request Path and click Connect.

    Enter the Request Path

  5. In Action, select Request and Operation, the endpoint that you want to call.

    endpoint

  6. 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).

demo

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

  1. MuleSoft Composer
  2. API Sharing for Anypoint Platform
  3. Connect Composer to Anypoint Platform

We’d love to hear your opinion on this post