24
Views
4
Comments
How to add batch functionality for Salesforce Integration?
Application Type
Reactive

I am currently leveraging the Salesforce integration that is provided by Outsystems. While this works fine for single records being sent to Salesforce at a time it does not allow for batches to be sent. My business case would greatly benefit from the ability to send batches rather than a single record. I copied the Salesforce_DRV module and added an additional method to support batches being sent but cannot figure out how to handle the authorization header/token or how to get it. Please let me know the best possible way to handle batching to Salesforce is/if I am doing it wrong.

2022-05-19 14-01-44
Varada Rajan

HI Timothi, 
You can use ,
Composite Batch API: Allows multiple REST API requests to be combined into a single call. Ideal for smaller batches (up to 25 sub-requests per batch).
Bulk API: Designed for handling large volumes of data. Suitable for asynchronous processing of large batches.

  • Choose the API based on your needs. For smaller, real-time batches, the Composite Batch API is usually sufficient.

UserImage.jpg
Timothy Mercendetti

Hi Varada, how do I create/access these api's? Do I need to create them manually or do they exist somewhere within the integration created by integration builder?

2026-01-28 16-57-48
Mihai Melencu
Champion

Hello @Timothy Mercendetti ,

Authorization

Salesforce API requires an OAuth 2.0 token for authentication.The token is typically fetched using a combination of the following: Client ID and Client Secret: Provided in Salesforce Connected App settings. Username and Password: Combined with a security token if applicable.

You must include the following headers: 

  • Authorization: Bearer <OAuth_Token>
  • Content-Type: application/json

Here is some information about getting the token and overall information about the authorization process:

  1. https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_tokens_scopes.htm&type=5
  2. https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_oauth_and_connected_apps.htm

Updating a List of Records

To update multiple records, you can use the Salesforce Bulk API, which is designed for handling large volumes of data. 

The Bulk API has a different endpoint structure. You would typically use the following endpoint to create a job. Here you have additional information about it:

  1. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/bulk_api_2_0.htm
  2.  https://www.bounteous.com/insights/2023/09/12/salesforce-overview-bulk-api-20/
2019-01-07 16-04-16
Siya
 
MVP

@Timothy Mercendetti besides Salesforce_DRV there is another module Salesforce_IS  which takes care of the Authentication. You can see a server action  like GetAccessToken & GetAccessToken_ForceRefresh in IS Module.

Consumer modules refer to methods from the IS module, which in turn call methods from the DRV module that interacts with Salesforce. To add a new method, you need to implement it in both modules.  To begin with, consume the REST end point in DRV module and then create a public wrapper method which call the REST API. Finally call the wrapper method in IS module. While calling the wrapper method you need to pass the AccessToken. You should be able to do this by referring an existing implementation.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.