You are on page 1of 6

1/4/22, 9:10 PM Article: How to Connect to Salesforce REST API with OAuth 2.

0 - Boomi Community

Boomi.com (https://boomi.com) Login

Community Programs Knowledge Training & Certification (/s/training) User Groups & Events Support

Search the Boomiverse

(https://community.boomi.com/s/100K-Donation)

How to Connect to Salesforce REST API with OAuth 2.0


Oct 28, 2018 • Knowledge Article

C R E AT E D B Y

Boomi Community (/s/profile/0051W000004srD2QAI), 12/31/2020 2:22 AM


LAST MODIFIED BY

Brett Brown(Inactive) (/s/profile/00540000003b09YAAQ), 12/31/2020 2:25 AM


CONTENT

The following describes the AtomSphere and Salesforce configuration to setup a connection to the Salesforce REST API with
OAuth 2.0 authentication.
IMPORTANT: This approach uses the HTTP Client connector, not the Salesforce connector. In Salesforce OAuth 2.0 terms, it
follows the web server flow (https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/intro_understanding_authentication.htm).
1. In Salesforce create a new Connected App in Salesforce (http://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/intro_defining_remote_access_applications.htm). This "Connected App" will represent
AtomSphere as a whole. Below is the relevant configuration:
Consumer Key
Consumer Secret (guard this as a password)
Selected OAuth Scopes:
Full access (full) - or customize based on the level of desired access
Perform requests on your behalf at any time (refresh_token, offline_access) - IMPORTANT Always add this to allow
the integration to automatically refresh the access token without user intervention
Callback URL = https://platform.boomi.com/account/<ATOMSPHERE-ACCOUNT-ID>/oauth2/callback

https://community.boomi.com/s/article/howtoconnecttosalesforcerestapiwithoauth20 1/6
1/4/22, 9:10 PM Article: How to Connect to Salesforce REST API with OAuth 2.0 - Boomi Community

To navigate back to the OAuth setup screen:


In Salesforce Classic UI, go to Setup | App Setup | Create | Apps | scroll down to Connected Apps | click the Connected
App Name (do not click Edit or Manage).

In Salesforce Lightning UI, go to Setup | Apps | App Manager | choose "View" from the drop down menu to the right
(do not choose Edit or Manage).

2. In AtomSphere create a new HTTP Connection. Below is the relevant configuration:


https://community.boomi.com/s/article/howtoconnecttosalesforcerestapiwithoauth20 2/6
1/4/22, 9:10 PM Article: How to Connect to Salesforce REST API with OAuth 2.0 - Boomi Community
URL = Base URL of your Salesforce org's REST API. Salesforce instance (e.g. na7) and version (e.g. v39.0) may differ. For
example, https://na7.salesforce.com/services/data/v39.0/. Remember the remainder of the API endpoint will be
configured in the Operation component.
Authentication Type = OAuth 2.0
Client ID = Consumer Key from Salesforce config above
Client Secret = Consumer Secret from Salesforce config above
Authorization Token URL = https://login.salesforce.com/services/oauth2/authorize (details
(https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm))
Scope = Leave blank
Authorization Parameters: None. Set automatically by connector.
Access Token URL = https://login.salesforce.com/services/oauth2/token (details
(https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm))
Access Token Parameters: None. Set automatically by connector.
3. Generate the access token:
Click Generate... next to Access Token. You will need to do this once. The token will be automatically refreshed upon
expiration.
AtomSphere dialog drops down and a new browser tab opens with the Salesforce authorization dialog.
In the authorization dialog click Allow. Browser tab redirects with simple message "Authorization Code received". Close
that browser tab.
Back in the connection, dialog updates to "Access Token generation successful". Dismiss dialog.
Access Token is now populated. Save and close connection component.
4. Create a new HTTP Operation. Below is the relevant configuration:
HTTP Method = GET (for queries) or POST (for creates, updates, upserts, deletes)
Resource Path = Configure static and/or dynamic resource path elements to construct the appropriate URL for the
desired action (https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/using_resources_working_with_records.htm). Examples:
Query: query/?q=SELECT+name+from+Account+LIMIT+2
Create: sobjects/Account/
5. Execute the process. Additional considerations:
Results are returned in a single JSON document.
Use an example response to generate a JSON profile for mapping.
When querying the HTTP connector will not automatically iterate through pages of results. The process must be
designed to recursively invoke the query with a nextRecordsUrl (https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/dome_query.htm) value if present. See Design Pattern: Handling API Pagination
(/s/article/ka21W000000boRJQAY/designpatternhandlingapipagination).
General Reference
Salesforce REST API developer guide (https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/intro_what_is_rest_api.htm)
Create a Connected App (https://help.salesforce.com/articleView?id=connected_app_create.htm)

AT TA C H M E N T

https://community.boomi.com/s/article/howtoconnecttosalesforcerestapiwithoauth20 3/6
1/4/22, 9:10 PM Article: How to Connect to Salesforce REST API with OAuth 2.0 - Boomi Community

Sort by:
Latest Posts Search this feed...

John Grogan (/s/profile/0051W000004uxyGQAQ) (Member)


September 3, 2019 at 8:38 PM (/s/feed/0D51W00007GQvtJSAT)
A few helpful hints in working with the above.
 
1) In your HTTP connection, set "GRANT TYPE" to "Authorization Code"
 
2) Logon as the service account you're using to access Salesforce when you generate the access token.
 
3) Take note of Salesforce's guidance as to URLs from article (https://developer.salesforce.com/docs/atlas.en-
us.196.0.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm (https://developer.salesforce.com/docs/atlas.en-
Expand Post
184 views

Like Comment

Log In to Comment

Boomi Community (/s/profile/0051W000004srD2QAI) (Dell Boomi) published a new version of this Knowledge Article.
October 28, 2018 at 5:00 PM (/s/feed/0D51W00006As3HoSAJ)
2 comments 142 views

Like Comment

More comments 1 of 2

Harshad Karanjkar (/s/profile/0051W000005jCWxQAM) (Member)


a year ago
Hello, Was anyone able to work around the problem mentioned above ?
Like

Log In to Comment

Boomi Community (/s/profile/0051W000004srD2QAI) (Dell Boomi) published this new Knowledge Article.
October 28, 2018 at 2:59 PM (/s/feed/0D51W00006Arz1xSAB)
34 comments 416 views

Like Comment

More comments 1 of 34

Latha A S (/s/profile/0051W000005IKRtQAO) (Member)


3 years ago
Hi,
I am getting the below error
Error attempting to retrieve OAuth Access token. unsupported_grant_type, grant type not supported.
 
Please let me know how to fix this.
 
Like

Log In to Comment

https://community.boomi.com/s/article/howtoconnecttosalesforcerestapiwithoauth20 4/6
1/4/22, 9:10 PM Article: How to Connect to Salesforce REST API with OAuth 2.0 - Boomi Community

Topics (1)
Connector Guides (/s/topic/0TO1W000000cfgAWAQ/connector-guides)

Trending Articles
LDAP Configuration, AcceptSecurityContext error, data 52e
(/s/article/ldapconfigurationacceptsecuritycontexterrordata52e)

How to Connect to Salesforce REST API with OAuth 2.0


(/s/article/howtoconnecttosalesforcerestapiwithoauth20)

String functions with examples


(/s/article/string-functions-examples)

How to Use Regex to Match Carriage Returns and Line Feed Characters in Search and Replace
(/s/article/howtouseregextomatchcarriagereturnsandlinefeedcharactersinsearchandreplace)

How Connection Licensing Works


(/s/article/connection-licensing)

Related Articles
Using the HTTP connector to connect to Netsuite 2021.2 using OAuth 2.0 (/s/article/Using-the-HTTP-connector-to-connect-to-Netsuite-2021
4.61K
-2-using-OAuth-2-0)

Using IFS Cloud OpenId Connect with OAuth 2.0 Authentication (/s/article/Using-IFS-Cloud-OpenId-Connect-with-OAuth-2-0-Authenticatio
351
n)

OAuth 2.0 in the HTTP Connector (/s/article/oauth2-in-the-http-connector) 12.49K

How to Connect to Box.com with OAuth 2.0 (/s/article/howtoconnecttoboxcomwithoauth20) 5.81K

Making Manual OAuth 2.0 Calls (/s/article/manual-oauth2-calls) 5.61K

TRY BOOMI

Boomi Community Additional Resources


Forums (/s/forums) Platform Login (https://platform.boomi.com)
Knowledge Base (/s/knowledge-base) Official Documentation (http://help.boomi.com)
Ideas for Boomi (/s/ideas) Platform Status (https://status.boomi.com)
News (/s/news) Training & Certification (https://boomi.com/services/training/)
Support (/s/support) Professional Services (https://boomi.com/services/professional-services/)
https://community.boomi.com/s/article/howtoconnecttosalesforcerestapiwithoauth20 5/6
1/4/22, 9:10 PM Article: How to Connect to Salesforce REST API with OAuth 2.0 - Boomi Community

Community Help (/s/community-help)


Company
Boomi.com (https://www.boomi.com/?utm_source=community)
About Boomi (https://www.boomi.com/company?utm_source=community)
Careers (https://www.boomi.com/company/careers?utm_source=community)
Company Blog (https://resources.boomi.com/blog-dell-boomi)
 
Privacy Policy (http://www.boomi.com/privacy?utm_source=community)
Terms of Use (/s/terms-of-use)
Community Guidelines (/s/article/DellBoomiCommunityGuidelines)
Contact Us (/s/article/ContactUs)

(https://twitter.com/boomi)(https://www.facebook.com/DellBoomi)(https://www.youtube.com/channel/UC63U1JBpElNL6anLEeS6fzw)(h
in

© Copyright 2022 Boomi, Inc. All Rights Reserved.

https://community.boomi.com/s/article/howtoconnecttosalesforcerestapiwithoauth20 6/6

You might also like