DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Writing a Vector Database in a Week in Rust
  • Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
  • Tomorrow’s Cloud Today: Unpacking the Future of Cloud Computing
  • Transactional Outbox Patterns Step by Step With Spring and Kotlin

Trending

  • Writing a Vector Database in a Week in Rust
  • Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
  • Tomorrow’s Cloud Today: Unpacking the Future of Cloud Computing
  • Transactional Outbox Patterns Step by Step With Spring and Kotlin
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. MuleSoft, Salesforce Request

MuleSoft, Salesforce Request

Let's take a look at this tutorial, which explains how to create a simple global HTTP connector to receive requests.

Ugo Augusto Gustavo Guazelli user avatar by
Ugo Augusto Gustavo Guazelli
·
Aug. 04, 18 · Tutorial
Like (5)
Save
Tweet
Share
12.64K Views

Join the DZone community and get the full member experience.

Join For Free

MuleSoft has Salesforce connectors that facilitate a request for Salesforce objects.

HTTP Connector:

We are going to create a simple global HTTP connector to receive our requests:

Image title

To make the example simple, we are going to create the following flow:

  • /accounts GET

Image title

HTTP config:

Image title

Salesforce Connector:

Drag and drop the Salesforce connector right after the GET HTTP:

Image title

Select Salesforce Basic Authentication, fill the username, password, and security token with Salesforce credentials. Click validate configurations to check the connection.

Image title

Salesforce Query ALL:

Going back to the Salesforce connector, select Query as Operation. We are going to use the following query to get some values from Account Object:

Note: You can use Query Builder to help you to build the query.

SELECT AccountNumber, BillingCity, BillingCountry, Id, Name, Phone FROM Account

Image title

Access http://localhost:8081/accounts from your browser. The result should be:

Image title

Salesforce Query by ID:

Now, let's go even further and come back to the Salesforce connector and edit the query:

SELECT AccountNumber, BillingCity, BillingCountry, Id, Name, Phone FROM Account WHERE Id = '#[message.inboundProperties.'http.uri.params'.id]'

Image title

You also have to edit the HTTP Connector so it can receive "id" as parameter.

/accounts/{id}

Image title

In doing so, you can try to request an Account passing id as parameter. From the browser, access http://localhost:1983/accounts/0016A00000ADPL4QAP

Note: You should be using an existing ID, otherwise, you will not get anything. You can use any ID from the first request result.

The result should be:

Image title

Requests MuleSoft Connector (mathematics)

Opinions expressed by DZone contributors are their own.

Trending

  • Writing a Vector Database in a Week in Rust
  • Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
  • Tomorrow’s Cloud Today: Unpacking the Future of Cloud Computing
  • Transactional Outbox Patterns Step by Step With Spring and Kotlin

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: