Connecting your first SaaS applications

Why integrate APIs with Anypoint Design Center

Flow designer in Anypoint Design Center is optimized for implementing common integrations in a web-based, graphical interface. Some of the benefits of flow designer include the ability to:


  • Quickly leverage connectors auto-generated from an API specification via REST Connect.
  • Easily click and add connectors to send/receive data to/from systems.
  • Visually map data using DataSense.
  • Fast and easy application deployment to the cloud.
you become a professional in Mulesoft you can Enroll now free Demo for Mulesoft training at onlineItguru  

Setup

  • Sign up for a free 30-day Anypoint Platform account if you haven’t done so yet. You'll need an account to access existing assets in Anypoint Exchange and create Mule Apps in the flow designer.
  • Get a Slack API token.
  • Sign up for a Salesforce Developer account. Take note of your credentials, we will need that later.
  • Reset your security token for Salesforce. You will get an email with your token. You will also need this in a later step.

Bridging APIs with Design Center

Within the Design Center, you can build a Mule application to integrate two APIs together and drive real business processes easily. The service you're about to create will perform the following tasks on a scheduled date/time:

  • Retrieve all leads from Salesforce.
  • These leads were auto-generated when you signed up for the developer account.
  • Call the Product API to get information about a specific product.
  • Aggregate leads and product data, to help members of the sales team have more context when engaging prospects.
  • Convert the data to a CSV file.
  • Upload the data to a specific Slack channel and/or individuals.

Creating a new Mule app

To start off, navigate to Anypoint Design Center and create a new Mule application project:

Select the Create button → Mule Application.
Fill out the name for your application (e.g. "Weekly-Product-Leads").
Press Create.


Adding a scheduler trigger

After you create the project, you'll be taken to the canvas of your new Mule Application's first flow. In this canvas, you can add different components to perform a variety of processes to help accomplish your tasks.

Since this Mule application will be running on a schedule, add the Scheduler component as your trigger:

  1. Click the Trigger button to add a new trigger.
  2. Select Scheduler from the modal that pops up.
  3. Configure your Scheduler with the following values to have the flow run immediately once the app starts, and continuously run every 5 minutes:

  • Scheduling Strategy: Fixed Frequency
  • Time Unit: Minutes
  • Frequency: 5
  • Start Delay: 0

4. Click the X on the top right of the modal to close and save.



Adding a Salesforce query

In order to run a Salesforce query of all new leads, you're going to add the Salesforce Connector onto the canvas, select the corresponding operation, and configure it. In the canvas:

  1. Click the + to add a new component in the flow.
  2. Scroll and select the Salesforce Connector.
  3. Select the Query operation.
  4. This will present you with the operation configuration window. Click the Setup link to configure the connector itself first.
  5. Enter/select the following connector configuration:

  • Connection Type: Username Password
  • Username: (Use credentials from Step 3 of the Get Set Up section)
  • Password: (Use credentials from Step 3 of the Get Set Up section)
  • Security Token: (Use token from Step 4 of the Get Set Up section)

6. Click Test to ensure the configuration is correct and works, then Save.

Next, you'll need to configure the Salesforce query operation by entering the SOQL query, which will return several fields from leads:

Enter the following for the fields:
Salesforce Query:

SELECT Id,FirstName,LastName,Company,Email,Phone FROM Lead WHERE CreatedDate = THIS_MONTH

Press the X on the top right of the modal to close and save the changes

you become a professional in Mulesoft you can Enroll now free Demo for Mulesoft online training at onlineItguru  
Share:

1 comment:

  1. Awesome article. It is so detailed and well formatted that i enjoyed reading it as well as get some new information too.
    Mulesoft Online Training
    Mulesoft Training in Hyderabad

    ReplyDelete

Search This Blog

Recent Posts