/sfdc-rest-api-boomi

Creative Commons Zero v1.0 UniversalCC0-1.0

Salesforce REST API Connectivity using Boomi

Problem Statement

There can be several teams in an organization who need to connect to a Salesforce organization to get/send data. Salesforce Architects usually recommend having separate users for separate projects so that the various access levels and roles can be segregated from a security standpoint.

Limitation of Native Salesforce Connector

Suppose if there are 7 separate users created for Boomi integration in a Salesforce organization, and we decide to use Boomi's native/out-of-box Salesforce Connector, it will cost 7 licenses, thereby increasing the operational cost of Boomi usage.

Benefits of using Salesforce REST API in Boomi Integrations

🔸 Reduced Boomi License Cost - Since a single HTTP Connector in Boomi can be used by parameterizing the credentials of different integration users.

🔸 Better Security - We can use OAuth 2.0 as the authentication and authorization mechanism for enhanced security.

🔸 Faster Connectivity - Boomi's native/out-of-box Salesforce Connector connects with the SOAP API of Salesforce, which can be slower at times, as compared to the REST API of Salesforce.

🔸 Faster Integration Enhancements - When we use Boomi's native/out-of-box Salesforce Connector to perform Salesforce QUERY operation, and have to update the SOQL to incorporate a new Salesforce field, we have to re-import the Salesforce Object in the Boomi's Salesforce Connector's Operation along with verifying the selected fields to avoid any additional fields being selected after the profile re-import. When we use Boomi's HTTP Connector to perform a Salesforce QUERY operation, we only have to edit the parameter in the URL Resource Path.

Solution Approach

🔸 Create a Connected App in Salesforce with the required configuration and access-levels.

🔸 Create the Main Boomi Process.

🔸 Create an HTTP Client Connector component and set the URL.

🔸 Create the required Operations for HTTP Client Connector component.

🔸 Create a common reusable sub-process to fetch the Salesforce Access Token.

Create Connected App in Salesforce

Please refer this Salesforce community article - https://developer.salesforce.com/docs/atlas.en-us.196.0.api_rest.meta/api_rest/intro_defining_remote_access_applications.htm

Create HTTP Client Connector in Boomi

🔸 URL: Enter the Base-URL.

https://<salesforce_instance_name>.my.salesforce.com

🔸 Authentication Type: None

image

Generate Salesforce Access Token

🔸 Create the payload in a Message shape, based on application/x-www-form-urlencoded Content-Type.

grant_type=password&client_id={1}&client_secret={2}&username={3}&password={4}
image

🔸 Set the HTTP Operation's Resource Path in a DDP, in the Set Properties shape.

DDP_Token_RPath: services/oauth2/token
image

🔸 Configure the HTTP Client Connector's Operation.

Select Request Profile Type: NONE
Select Response Profile Type: JSON
Content Type: application/x-www-form-urlencoded
HTTP Method: POST
image

🔸 The HTTP Client Connector's URL sent to Salesforce from Boomi to generate the Access Token will be like below.

https://<salesforce_instance_name>.my.salesforce.com/services/oauth2/token

🔸 Store the value of Access Token in a DPP.

DPP_Access_Token: Bearer <value_of_access_token_recieved_from_salesforce>

Salesforce QUERY Operation

🔸 Configure the HTTP Client Connector's Operation.

Select Request Profile Type: NONE
Select Response Profile Type: JSON
Content Type: application/json
HTTP Method: GET
Request Headers: Authorization : <value of DPP_Access_Token>

🔸 The HTTP Client Connector's URL sent to Salesforce from Boomi to fetch an Account record will be like below.

https://<salesforce_instance_name>.my.salesforce.com/data/v58.0/query/?q=SELECT+Id,+Name,+Phone+FROM+Account+WHERE+Id=%27<salesforce_record_id>%27

Salesforce CREATE Operation

🔸 Configure the HTTP Client Connector's Operation.

Select Request Profile Type: JSON
Select Response Profile Type: JSON
Content Type: application/json
HTTP Method: POST
Request Headers: Authorization : <value of DPP_Access_Token>

🔸 The HTTP Client Connector's URL sent to Salesforce from Boomi to create an Account record will be like below.

https://<salesforce_instance_name>.my.salesforce.com/services/data/v58.0/sobjects/Account

Salesforce UPDATE Operation

🔸 Configure the HTTP Client Connector's Operation.

Select Request Profile Type: JSON
Select Response Profile Type: JSON
Content Type: application/json
HTTP Method: POST
Request Headers: Authorization : <value of DPP_Access_Token>

🔸 The HTTP Client Connector's URL sent to Salesforce from Boomi to update an Account record will be like below.

https://<salesforce_instance_name>.my.salesforce.com/services/data/v58.0/sobjects/Account/<salesforce_record_id>?_HttpMethod=PATCH

Salesforce UPSERT Operation

🔸 Configure the HTTP Client Connector's Operation.

Select Request Profile Type: JSON
Select Response Profile Type: JSON
Content Type: application/json
HTTP Method: POST
Request Headers: Authorization : <value of DPP_Access_Token>

🔸 The HTTP Client Connector's URL sent to Salesforce from Boomi to upsert an Account record will be like below.

https://<salesforce_instance_name>.my.salesforce.com/services/data/v58.0/sobjects/Account/<salesforce_external_id_field_name>/<salesforce_external_id_value>?_HttpMethod=PATCH

List of Abbreviations

Abbreviation Definition
REST Representational State Transfer
API Application Programming Interface
HTTP Hypertext Transfer Protocol
OAuth open authorization
SOAP Simple Object Access Protocol
URL Uniform Resource Locator
DDP Dynamic Document Property
DPP Dynamic Process Property