This document describes steps to enable OAuth2 authentication and how to update records in Salesforce using API

Setting Connect App in Salesforce

  • Login as Salesforce Admin user where you can set up a connected app by clicking the Setup icon in the top-right navigation menu and select Setup.
  • Enter App Manager in the Quick Find box and then select App Manager.
  • Click  on New Connected App.
  • In the New Connected App form, fill information in below sections

Basic Information: 

Connect App Name: YourAppName.
API Name: this will automatically become ‘YourAppName’.
Contact Email: enter your email address.

API (Enable OAuth Settings) section:

Check Enable OAuth Settings.
Callback URL:  Please enter https://auth.enboarder.com/oauth

Under Selected OAuth Scopes:

Select Access and manage your data (API).
Click Add.
Select Perform requests on your behalf at any time (refresh_token, offline access)
Click Add.

Once you’ve set up your app, you’ll be given a Consumer Key and a Consumer Secret for your app. Please note it down.

Setting up Saleforce Tile 

Role required :admin 

Here are the steps for Integration:

  • Login as admin user and go to Settings → Integration → App centre
  • Click on the tile Sendoso (or search if you can't see it) for which you want the integration setup.
  • Click on Add Integration button.

  • On next screen, enter the login URL,  any additional scope and then click next

Note - By Default we are adding scope for API and offline access, If you want additional  scope, please see below link

https://help.salesforce.com/articleView?id=remoteaccess_oauth_tokens_scopes.htm&type=5

  • On next screen,  enter Consumer Key(clientID) and Consumer Secret , then click on Integrate Now button

The system will redirect you to Salesforce site, enter your Salesforce credential:

Once logged in, request for information access will be asked. Once this is allowed, the customer instance will be setup, and the integration is completed.

The system will show tile as integrated.

Update existing record in Salesforce

URL - https://INSTANCE.salesforce.com/services/data/v42.0/sobjects/{{salesforceObjecName}}/{{id}}

Salesforce record ID 

In order to update existing record, please get the record id from database. Go to detail of record and copy the id from URL

Sample Payload:  

The JSON key should be same as Salesforce  field api name.

{
  "firstName__c": "{{newhire_name}}",
  "email__c": "{{newhire_email}}"
  "mobile__c": "{{newhire_mobile}}"
  "empID__c": "{{custom / empNumber}}"
}

Response:

On Successful you will get below response

{
  "id":"0031r000029NDckAAG",
  "success":true,
  "errors":[]
}

Webhook setting

While configuring web-hook, please select authentication as Salesforce and remove any additional header/key row

Did this answer your question?