MuleSoft to Intento API Connector

In this MuleSoft to Intento API Connector guide, you will learn how to:

  1. Get the Connector

  2. Use the Connector

  3. Create Translate Operation

  4. Get Operation By ID Operation

  5. Testing

Get the Connector

At the moment, the easiest way to get the connector is to create an API asset in MuleSoft Design Center by uploading the Intento API OAS YAML

Use the Connector

The connector has two operations:

  1. Create Translate

  2. Get Operation by ID

This section demonstrates how to call them using MuleSoft HTTP Listener as a trigger.

To use any of the Intento API operations, provide a configuration for the Connector once it is added to the first Flow. After that, you can reuse the configuration:

1-reuse the configuration.png

Using DataWeave for Create Translate Operation, assume you constructed a flow:

2-Assume you constructed a flow.png

As DataWeave detects both input and output formats, you can set fixed output parameters like provider and async in our example and connect dynamic ones, like to, from, and text:

3-from and text.png4-from and text.png

Dynamic ones are shown as null in the preview since no data is available to display.

Using DataWeave for the Get Operation By ID request is redundant, but we can use it to transform the response:

5-transform the response.png

The only parameter you have to set is the operation ID (in our example, from the HTTP Listener query parameter ID):

6-Listener query parameter id.png7-Listener query parameter id.png

Testing

Once the application is deployed, you can trigger its flows:

Request a translation:

8-request a translation.png

Get the result by ID:

9-Get the result by id.png