0% found this document useful (0 votes)
210 views12 pages

Integrating Salesforce Via REST API - DetailedTutorial

Uploaded by

hhhh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
210 views12 pages

Integrating Salesforce Via REST API - DetailedTutorial

Uploaded by

hhhh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 12

20.02.

2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Veon Blog | Useful tips and latest technology news Contact Us 


Salesforce integration
using REST API –
Home / salesforce / Salesforce integration using REST API – Explained step by step
Explained step by
step

Search... 
Salesforce integration using REST API – Explained
step by step

In this article, we are going to see the step-by-step


procedure on how to connect to Salesforce using
Postman for performing integration tests. The tutorial is
fairly elaborate and contains, details on how to
authenticate, retrieve details of a record, create a new
recordCRM and run SOQL INTEGRATION
SERVICES queries within Salesforce.RESOURCES
SERVICES Though
we are using Postman for this tutorial, you can use this We take your
tutorial to call Salesforce REST API from virtually any privacy seriously.
SugarCRM SAP Magento Veon Blog
otherServices
application capable of calling REST protocol. Please go
Integration
Case Studies through the
Salesforce
SuiteCRMprovides “Connected App” to connect with the
SAP Salesforce below link to
platform with any other application.
Services Integration As we will Customer
be using read about our
Testimonial
this capability of Salesforce, so lets learn a bit more about privacy policy.
it.Small Business SAP
CRM BigCommerce Privacy Policy
4
Integration
Salesforce Connected App
“Connected App” is an applicationGDPR which Acceptance
connects
Salesforce org with an external
Copyrightapplication. It uses
2021 Veon Consulting Pvt Limited.
Thisstandard
website uses cookies
SAML andtoOAuth
improveprotocols
your experience. We'll assume you're ok with this, but you can opt-
to authenticate,
provide single sign-on,outand
if youprovide tokens
wish. Accept
  toReject
use with
Read More Конфиденциальность -

Salesforce APIs.
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 1/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Getting started with Salesforce Connected


App Veon Blog | Useful tips and latest technology news Contact Us 
Quick
Below are the steps to create a connected app in
Contact
Salesforce

Go to Setup->Build->Create->Apps Name *

Email *

Skype ID

Services *

Requirements *

Click on ‘New’ Button in “Connected App” section,


Below screen will be shown

GET IN TOUCH

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Enter the Name of the Application. Case Studies through the
Enter Contact Email
SuiteCRM SAPand any additional information
Salesforce below link to
suitable for your application.
Services Integration Customer read about our
Enable OAuth settings in API section. Testimonial privacy policy.
Small Business
Enter a Callback URL. This SAPis the URL that a user’s
CRM is redirected
browser BigCommerce
to after successful Privacy Policy
4
authentication. Here Integration
I’m giving
“https://login.salesforce.com/services/oauth2/callback”
as callback URL. You can enter multiple callback
URLs but, you have to make sure GDPR that callback URL
Acceptance
must be secured and if multiple URLs are used, they
Copyright 2021 Veon Consulting Pvt Limited.
should
This website be separated
uses cookies by your
to improve line experience.
breaks. We'll assume you're ok with this, but you can opt-
Add Selected OAuth Scopes. Here I’m giving “Full
   Reject Read More
access(full)”. out if you wish. Accept Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 2/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Veon Blog | Useful tips and latest technology news Contact Us 

Click on ‘Save’ button.


Click on ‘Continue’
You will be redirected to your Connected App’s Page

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce
After creating the Connected App below link to
Services Integration Customer read about our
Testimonial
1. Click on Click to reveal link to get Consumer secret. privacy policy.
Small Business SAP
2. Make a note of “Consumer Key “ and “Consumer
CRM as you need BigCommerce Privacy Policy
secret”, these details to authenticate
Integration
4 the external application.
3. Goto Manage->OAuth Policies-> select IP
restrictions as “Relax IP restrictions”.
GDPR Acceptance
With the completion of this step, now we will see how
Copyright 2021 Veon Consulting Pvt Limited.
to call
This website and
uses integrate
cookies Salesforce
to improve with Postman.
your experience. We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 3/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Understanding basics of Postman 


Veon Blog | Useful tips and latest technology news Contact Us 
Postman is an application for interacting with HTTP APIs.
It has powerful testing features and user friendly GUI for
making requests and reading responses.

Getting started with Postman

1. Install Postman by going to Postman APPs . It is also


available as Add-On for Google Chrome. If you wish
to install it as a plugin, navigate to Google Chromes
web-store->search for Postman and add it to
chrome.
2. Launch Postman, below screen will be shown

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce below link to
Services Integration Customer read about our
Testimonial privacy policy.
Integrating
Small BusinessSalesforce
SAPusing REST API
CRM BigCommerce Privacy Policy
Now that are equipped with understanding Salesforce
Integration
integration, lets get to our main objective of integrating
4
Salesforce with third party application. For this we have
the following steps.
GDPR Acceptance

Copyright 2021 Veon Consulting Pvt Limited.


ThisStep #1.uses
website Setting
cookies up the HTTP
to improve login request
your experience. URL
We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 4/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

We are going to set request URL by (Base URL +


Parameters), below tips
Veon Blog | Useful is the structure
and to construct
latest technology news Contact Us 
request URL for Salesforce org
https://login.salesforce.com/services/oauth2/token?
grant_type=password&client_id=YourConsumerKey&client_secret=YourConsume

In the above URL replace highlighted text with


YourConsumerKey: Consumer Key obtained
from Connected App.
YourConsumerSecret: Consumer Secret
obtained from Connected App.
SalesforceUserName: Salesforce User ID.
SalesforcePassword: Provide the login
credentials of Salesforce

Step #2. Authenticating your request with


Salesforce

Create a POST method and Copy the request URL as


shown below and click on send.

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce below link to
Services Integration Customer read about our
Testimonial privacy policy.
Small Business SAP
CRM BigCommerce Privacy Policy
4
Integration
On successful login, you will get Instance-URL, Access
token, Token-type. This Access token is further used
as a parameter value in HeaderGDPR to send any HTTP
Acceptance
requests and get theCopyright
response from Salesforce. So,
2021 Veon Consulting Pvt Limited.
make
This website a note
uses of to
cookies access_token as shown We'll
improve your experience. in the figureyou're ok with this, but you can opt-
assume
above.   
out if you wish. Accept Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 5/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Business Case #1. Retrieving record details from


Salesforce
Veon Blog | Useful tips and latest technology news Contact Us 

Now we will see how to get details of a record from


Salesforce object using the GET.  Below is the Sample
URL.

https://instanceurl/services/data/v25.0/sobjects/Objectname/Id

In the above URL replace highlighted text with


Instanceurl: Instanceurl obtained in the same
manner.
Object Name: SObject’s like Account, Contact,
Lead etc.
Id: This is the salesforce Id of particular record
of the SObject that you have selected.
Create a GET method, copy the URL and copy the
Access token along with Token type in Header section
as shown below

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce below link to
Services Integration Customer read about our
Testimonial privacy policy.
Small Business SAP
CRM
Click BigCommerce
on the send button. In the response, you will get Privacy Policy
Integration
4 all the Account details of that particular record as
shown below.

GDPR Acceptance

Copyright 2021 Veon Consulting Pvt Limited.


This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 6/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Veon Blog | Useful tips and latest technology news Contact Us 

Business Case #2. Running SOQL queries in


Salesforce using REST 

SOQL are parallel to database query. If you wish to


learn more about SOQL queries click on the link. We
will see how to fetch data using SOQL query using
the GET. Below is the sample URL.

https://instanceurl/services/data/v25.0/query?
q=SOQL-Query INTEGRATION SERVICES
CRM SERVICES RESOURCES
We take your
In the above URL replace highlighted text with privacy seriously.
SugarCRM SAP Magento
Instanceurl: Instanceurl obtained inVeon Blog
example Please go
Services
above. Integration
Case Studies through the
SOQL-Query: Each word in SOQL Query should below link to
SuiteCRM SAP Salesforce
be separated with ‘+’ as shown belowCustomer
Services Normal SOQL:
Integration read about our
Select Id, NameTestimonial
from privacy policy.
Small BusinessAccount SAP
CRM Postman SOQL:
BigCommerce Privacy Policy
Select+Id+,+Name+from+Account
Integration
4
Repeat the steps and click on send button, In the
response, you will get Id, Name for all the records as
shown below GDPR Acceptance

Copyright 2021 Veon Consulting Pvt Limited.


This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 7/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Veon Blog | Useful tips and latest technology news Contact Us 

Business Case #3. Creating a record in


Salesforce using REST

Now we’ll see how to add records to salesforce object


using POST method. Below is the sample URL.

https://instanceurl/services/data/v25.0/sobjects/Objectname

In the above URL replace highlighted text with


Instanceurl:INTEGRATION
CRM SERVICES
Instanceurl obtained in the
SERVICES
same
RESOURCES
way as described above. We take your
Object Name: SObject’s like Account, Contact, privacy seriously.
SugarCRM
Lead etc. SAP Magento Veon Blog
Please go
Services Integration
through the
Create a POST method, copy the URL andCase copyStudies
the below link to
SuiteCRM SAP Salesforce
Access token in the Header section. In the body read about our
Services
section provide the details of record either Customer
Integration in XML or privacy policy.
Testimonial
JSON format. Here I’m providing data in XML format.
Small Business SAP
CRM BigCommerce Privacy Policy
4
Integration

GDPR Acceptance

Copyright 2021 Veon Consulting Pvt Limited.


This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 8/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Veon Blog | Useful tips and latest technology news Contact Us 

Click on the send button. In the response, you will get


the SalesforceId of the record if the record is added
successfully to Salesforce org else you will get the
error message.

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce below link to
Services Integration Customer read about our
Testimonial privacy policy.
Small Business SAP
CRM BigCommerce Privacy Policy
4
Integration

GDPR Acceptance

Copyright 2021 Veon Consulting Pvt Limited.


This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 9/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

This marks the completion of our tutorial on how to


create,Veon
retrieve
Blogand querytips
| Useful records in Salesforce
and latest using
technology news Contact Us 
REST APIs.

How we can help

Our team can help you customize and integrated


Salesforce as per your business process. Read about
our Salesforce Integration Services. Reach out to us for a
free assessment of your business needs.

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
By Veon Consulting | June 14th, 2018 | salesforce |4 Please go
Services Integration
Comments Case Studies through the
SuiteCRM SAP Salesforce below link to
Services Integration Customer read about our
Testimonial privacy policy.
Small Business SAP
AboutCRMthe Author: Veon Consulting
BigCommerce Privacy Policy
4
Integration
Veon brings best in consulting and
integration solutions on Salesforce,
SugarCRM, and SAP. ItGDPR is anAcceptance
innovative
company which deals best of the breed
Copyright 2021 Veon Consulting Pvt Limited.
Thissolution using
website uses integration
cookies to improvesolutions on the We'll
your experience. aboveassume you're ok with this, but you can opt-
platforms. making small and mediumenterprise
out if you wish. Accept  Reject become
Read More
smarter.
Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 10/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Veon Blog | Useful tips5and latest technology news Contact Us 

Article Rating

 Subscribe   Login

Join the discussion

{} [+] 

4 COMMENTS   Oldest

swayam
 2 months ago

Very nice explanation. Thank you

2 Reply

Veon Consulting (@admin) Author

 Reply to 
swayam  2 months ago

CRM SERVICES INTEGRATION SERVICES RESOURCES


Glad that you liked it. We take your
privacy seriously.
SugarCRM
0 ReplySAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce below link to
Services
utkarsh Integration Customer read about our
 2 months ago Testimonial privacy policy.
Small Business SAP
Thnks ,CRM
it was best.. BigCommerce Privacy Policy
4
Integration
0 Reply

GDPR Acceptance
Veon Consulting (@admin) Author
Copyright 2021 Veon Consulting Pvt Limited.
This website uses cookies to to 

 Reply improve
utkarshyour
 2experience.
months agoWe'll assume you're ok with this, but you can opt-

out if you wish. Accept


  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 11/12
20.02.2022, 23:57 Integrating Salesforce via REST API - DetailedTutorial

Thanks Utkarsh.
Veon Blog | Useful tips and latest technology news Contact Us 
0 Reply

CRM SERVICES INTEGRATION SERVICES RESOURCES


We take your
privacy seriously.
SugarCRM SAP Magento Veon Blog
Please go
Services Integration
Case Studies through the
SuiteCRM SAP Salesforce below link to
Services Integration Customer read about our
Testimonial privacy policy.
Small Business SAP
CRM BigCommerce Privacy Policy
4
Integration

GDPR Acceptance

Copyright 2021 Veon Consulting Pvt Limited.


This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-
out if you wish. Accept
  Reject Read More Конфиденциальность -
Условия использования

https://www.veonconsulting.com/salesforce-rest-api-explained/ 12/12

You might also like