Integrate Salesforce with Postman using connected app with OAuth 2.0 to perform API calls.
Summary
TLDRThis tutorial guides viewers on integrating Salesforce with Postman for API development and testing. It covers creating a Connected App in Salesforce, configuring Postman, and making API calls. The process includes setting up authentication, generating security tokens, and using Postman's collection to organize API requests. The video also demonstrates creating and retrieving account records via API calls.
Takeaways
- 🔗 To integrate Salesforce with Postman, start by creating a Connected App in Salesforce's classic UI.
- 📧 The Connected App requires mandatory fields like the app name, contact email, and settings for callback URL and authorization scopes.
- 🔑 After creating the Connected App, retrieve the client ID and client secret from the 'Manage Consumer Details' section for Postman configuration.
- 🛡️ Ensure you have a security token generated in Salesforce, which is essential for the authentication process in Postman.
- 📂 In Postman, create a collection to organize API requests to Salesforce.
- 🗝️ Use OAuth 2.0 for authorization in Postman, configuring it with the client ID, client secret, username, and a combined password with the security token.
- 🌐 Set the access token URL to request the token from Salesforce's services.
- 🔄 Postman will generate an access token after successful authentication, which is used for subsequent API calls.
- 📝 Make API calls to Salesforce using the generated access token, with endpoints and methods such as POST for creating records and GET for retrieving them.
- 📖 Refer to Salesforce's documentation for a list of standard endpoint URLs that can be used for API calls.
- 🎯 Demonstrated in the script is the process of creating an account record in Salesforce via Postman and retrieving its details using the API.
Q & A
What is the main topic of the video script?
-The main topic of the video script is integrating Salesforce with Postman to develop and test API functionalities.
Why is it necessary to use the classic UI of Salesforce for creating a Connected App?
-The classic UI of Salesforce is necessary for creating a Connected App because the creation of Connected Apps is only accessible via the classic mode.
What is the purpose of creating a Connected App in Salesforce?
-The purpose of creating a Connected App in Salesforce is to enable login via the app, allowing users to authenticate with Salesforce or through Postman.
What is the significance of the contact email in the Connected App configuration?
-The contact email in the Connected App configuration is significant because it is where notifications about failures in the login process or restrictions during integration are sent.
What is a callback URL in the context of the Connected App?
-A callback URL is the URL or page where the user will be redirected after successful authentication from a third-party system like Postman.
What does the scope setting in the Connected App configuration determine?
-The scope setting in the Connected App configuration determines the permissions and authorizations granted to the user making API calls, such as creating, reading, or deleting records or metadata in Salesforce.
Why is it important to generate a security token in Salesforce?
-The security token in Salesforce is important because it is an additional layer of security used during the login process, appended to the user's password to authenticate their identity.
How does Postman use the client ID and client secret from the Connected App?
-Postman uses the client ID and client secret from the Connected App to authenticate and configure the integration with Salesforce, allowing API calls to be made.
What is the authorization process in Postman for Salesforce?
-The authorization process in Postman for Salesforce involves using OAuth 2.0, where Postman authenticates itself with Salesforce using a username, password, and security token to generate an access token.
How can you create a new record in Salesforce using Postman?
-You can create a new record in Salesforce using Postman by making a POST request to the Salesforce API endpoint with the necessary data in JSON format.
What is the method used to retrieve an existing record's details in Salesforce via Postman?
-To retrieve an existing record's details in Salesforce via Postman, you use the GET method and append the record ID to the Salesforce API endpoint URL.
Outlines
🔗 Setting Up Salesforce Connected App
The speaker begins by addressing the audience and expressing a desire to discuss the integration of Salesforce with Postman, a tool commonly used by developers for API development and testing. The integration process is outlined, starting with the creation of a Connected App within Salesforce, which is accessible only in the classic UI. The audience is guided through the creation of a new Connected App, with emphasis on mandatory fields such as the name, contact email, and settings for authorization. The callback URL, where users are redirected post-authentication, and the scope of permissions granted to the user for API calls are also discussed. The session concludes with instructions on retrieving the client ID and client secret from the Connected App for use in Postman.
🔐 Generating Security Token for Salesforce
The second paragraph delves into the concept of the security token in Salesforce, which is crucial for the integration process. The speaker instructs on how to generate and retrieve the security token from the user's settings. This token serves as an additional layer of security during the login process, appending to the user's password to authenticate identity. The paragraph transitions into configuring Postman, starting with the creation of a collection to house API requests. The focus then shifts to setting up OAuth 2.0 authorization, detailing the steps to authenticate with Salesforce using username, password, and security token. The configuration involves specifying the access token URL, client ID from the Connected App, and the client secret, culminating in the generation of an access token for API requests.
📝 Making API Calls with Postman
The third paragraph explains how to make API calls to Salesforce using Postman after the integration and authorization steps are completed. The speaker demonstrates how to create a request within Postman to interact with Salesforce, starting with the creation of an account via a POST method. The process involves appending the correct endpoint URL to the domain, selecting the POST method, and providing necessary account information in JSON format within the request body. The speaker also shows how to retrieve account details using a GET method, appending the account ID to the endpoint URL to fetch specific records. The paragraph concludes with a demonstration of creating an account and retrieving its details, showcasing the successful integration of Postman with Salesforce.
📡 Conclusion of Salesforce and Postman Integration
In the final paragraph, the speaker summarizes the integration process of Salesforce with Postman, highlighting the ability to create and retrieve records through API calls. The speaker expresses gratitude for the audience's attention and bids them farewell, concluding the tutorial on integrating Salesforce with Postman for API development and testing.
Mindmap
Keywords
💡Salesforce
💡Postman
💡Connected App
💡API
💡Authentication
💡Callback URL
💡Scope
💡Client ID and Client Secret
💡Security Token
💡Collection
💡Endpoint
Highlights
Introduction to integrating Salesforce with Postman for API development and testing.
Step-by-step guide to creating a Connected App in Salesforce.
Explanation of the mandatory fields required for Connected App creation.
The importance of the contact email for receiving login failure notifications.
Enabling settings for authorization and callback URL configuration.
Setting permissions and authorization scopes for the Connected App.
Details on retrieving the client ID and client secret from the Connected App.
The concept of Salesforce security tokens and their generation.
How to create a collection in Postman for organizing API requests.
Configuring OAuth 2.0 authorization in Postman.
Using password credentials for authentication with Salesforce.
Combining the password and security token for Postman configuration.
Generating an access token for Salesforce API calls.
Making API calls to Salesforce using Postman.
Creating an account in Salesforce directly from Postman.
Retrieving account details from Salesforce using Postman.
Conclusion and summary of the integration process.
Transcripts
hello sfdc folks I hope everyone is
doing good so today we are going to
discuss about most widely used feature
or functionality that is integrating
Salesforce with Postman so many of times
developer usually integrate Salesforce
with Postman to develop and test the API
related functionalities which is very
useful for them so we'll know how to How
we'll integrate these two systems we'll
discuss the whole process starting from
creating a Connected app to configuring
in the postman and also we'll do some
demo API calls from Postman as well so
the first and foremost step to build
this integration is to create a
Connected app inside Salesforce so we'll
go
to
our Connected app creation setup page so
make sure you are on the classic UI of
Salesforce or because creation of
Connected app will be accessible via
classic mode only so search for apps in
in the search box click on apps and
there you will find the option called
connected apps here click on new to
create a new Connected app this
Connected app will be used for login
purposes via this Connected app only the
user will be able to log Salesforce or
through Postman so this is the medium of
login the first there will be some
mandatory things to fill that we can
definitely do that so let's get give the
name of the Connected app as Postman
int and the API name will be
automatically populated contact email
this is important because whenever if
there is any failure in the login
process or there is any restriction done
during the integration procedure
then the email will be sent to this
particular email ID just to inform the
person that hey this particular request
has been failed or whatever be the
reason the other things are optional
that you can definitely configure later
so the second thing that we'll do now is
enable all settings this is really very
important what sort of authorization you
want to make via this Connected app so
first option is call back URL this is
nothing but the URL where the user will
be redirected to after the
authentication is successfully done so
in order to make it simple I will just
skip my domain URL as my call back URL
so let me repeat it once again call back
URL is nothing but it is the URL or the
page where the user will be redirected
to after he has
successfully being
authenticated from the third party
system then the second option is the
scope that we have to select what all
permissions what all authent
authorization that you want to give to
that user who will be integrated he who
will be making the API calls or whether
he can create records or read records or
he can also
delete the metadata inside the
Salesforce or so for now we'll give full
access just for the training purpose we
are giving full access but in real
system real scenario it can be different
out of all these options you can select
multiple options as your wish now these
are the only important uh information
that you want to fill that you have to
fill to create a Connected app so after
you save it it will take 10 minutes to
get it ready and that is why I have
already created the Connected app with
the same name just to save time it will
take 10
minutes so
I already have this Postman integration
in Connected app created so what all
information you want to take from this
Connected app in order to proceed with
the configuration of the entire
integration so you have to click on that
manage consumer details this will give
you client ID and client secret that
will be used in our Postman while
configuring the integration so let's
click on this it will ask for
the uh OTP which is access code just to
see that
information we'll provide
that 3
4 5 9 9
6 now I should be able to see these two
information consumer key is nothing but
client ID and consumer secret is client
secret we'll require this let let this
page be open for now
and yeah this is the this is all what
Connected app part is now done the next
thing we'll go to our Postman app to
build the configuration between these
two so before going there I would like
to discuss one important very important
thing there is a concept of security
token inside Salesforce that you can
generate from here click on your name
click on my
settings and here you can search for
token
see there is an option called reset my
security token if you have not already
reset your security token or you do not
have it handy you can click on it and
you'll receive an email con containing
your security token that will be used
when we will be configuring Postman to
build the integration this is nothing
but an additional information apart from
your password to login into
Salesforce for example if you want to
login into Salesforce by entering
username and password then this security
token will be appended with your
password just to provide your whole
identity we'll use this so make sure you
reset your security token and keep it
handy somewhere let's go to our Postman
now the first step here is to create a
collection this is nothing but a folder
it's a folder only which will contain
all my requests that that I would make
to my Salesforce org let's create a
collection
and name it as
Postman to
SF the type of this particular colle the
type of authorization it is saying what
type of authorization you want to use I
will use o 2.0 which is the strongest
authorization or we can say the
strongest authentication
process so there are few fields and
information that we want to provide in
order to authenticate our s
first of all we have to authenticate
ourself and then only we can make
requests API request to our Salesforce
or here it is configure new token so
every time I will configure myself I
will authorize myself it will create
generate a an access token an access
token will be used to login so let's
start let's use the CR type as password
credentials that means I want to
authorize myself based on my user
username and password along with
security token let's give the token name
as SF
token here the first option access token
URL from where this Postman fetch the
access token where will it go I have to
provide the URL of that particular uh
box or something particular or where
where the postman will go to request for
the access token after providing all the
identity so this URL is this one login.
salesforce.com SLS Services
2.0 token this is the URL where it goes
and
fetches the access token this is the
first if it is a Sandbox or then it will
be nothing but test. sales force instead
of login. Sal Force but this will remain
the same or to/ token
next is we have to provide the client ID
of that connected app which we are using
to log
in so I have
already yeah open that page let's copy
the consumer key
here and go to our Connected app again
paste it over here the second thing is
client secret which
is consumer
secret we'll provide this information
here as well and the username which user
wants to log to the Salesforce
or I have my username
here and yeah then comes this very
important part which is password this is
not just your password but it is a
combination of your password and the
security token so let me show how it
works so suppose your Salesforce off
password is
c 1 2
3 at the
rate and
your security token that got generated
is something like this XY zmo and so
when you are configuring Postman you
have to provide your password like this
your normal password appended with your
security token so make sure there is no
space no underscore
nothing between the password and the
security token it will be one single
word okay so here I already have my
password to security token we'll provide
it over here and the last thing is
client authentication you select it as
client set send client details in body
now we'll get the access token after
providing all the authentication
information will generate the access
token this is complete and after
generating we just have to use this
token okay so see this particular token
field got
automatically populated after I used it
after generation when I clicked on use
token this got automatically populated
we'll save this now our authorization is
done will start making API calls to our
Salesforce or so what will I do is
inside this folder I will create a
request nothing but
a API request so since the integration
configuration is now done I will start
making API calls so for the to make API
calls we have to first so add a endpoint
endpoint URL which particular request
you want to
make I will first try
to create one account directly
from Postman to
Salesforce so in order to get more
information of endpoints here is a you
can refer to this article which contains
all the in important URLs that you can
call from the third party
system which are these are actually some
standard endpoint URLs that you can
leverage so I will make use of this
particular URL just to get the basic
information of account
object okay let me copy this is my
domain URL appended with this Services
SL API version and S
objects okay I just copied the wrong
thing maybe let me just select
again after my domain URL I will this
part and yeah so if I want to create an
account so I will use Post Service post
method and inside the body I'll provide
the information of that account that is
so like name and all other information
that I want to provide while to create a
account account
created from
API
name so this should be the name of my
account if I send this
request okay what is it text plan is not
supported if okay I you I have to use
here Json so the body that I'm sending
as an input parameter that should be in
the form of Chason and not text see this
account has been created in my or if I
just copy the ID and go to my or
directly just to
see my newly created
account I want to paste the ID but the
URL is too long so now I can paste my ID
over
here H it and yeah see this account just
got created the name is account created
from API
post great so this is see this just got
created with my
name and if I would have provided other
values in the fields that would have
that would have also been
populated now let's make the second call
so let let let's skip this one this
request just for post
account we'll create another request to
get the Account
Details okay use this same
URL but this time with a different
method which is get method and in order
order to fetch the exact record account
record we'll just provide the ID of that
record so let me provide the ID here the
URL is same just appending it with an ID
let's get the details of this account
see we got
it the name and all other fields which
are for
now
null so yeah this is how Postman got
integrated with Salesforce and you can
start making API calls you can create
records get records you can do other
different things thank you for watching
goodbye
浏览更多相关视频
What is Postman and why everyone use it ?
Postman Beginner Tutorial 13 | Data Driven Testing | How to get data from CSV and JSON files
Postman Beginner Tutorial 1 | What is Postman
NestJs REST API with MongoDB #4 - Authentication, Login/Sign Up, assign JWT and more
JWT Authentication with Node.js, React, MySQL | Node JS Authentication With JSON Web Token
ReactJS Music Player #4: Integrating the Spotify Api in our React App
5.0 / 5 (0 votes)