Integrate Salesforce with Postman using connected app with OAuth 2.0 to perform API calls.

Khan’s Tech Videos
2 Apr 202315:43

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

00:00

🔗 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.

05:00

🔐 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.

10:03

📝 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.

15:05

📡 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

Salesforce is a cloud-based customer relationship management (CRM) service that provides businesses with a suite of tools to manage their customer interactions and data. In the context of the video, Salesforce is the primary system being integrated with Postman for API development and testing purposes. The script mentions creating a 'Connected app' within Salesforce, which is a prerequisite for the integration.

💡Postman

Postman is an application used for API development that helps developers build, test, and document APIs. In the video, Postman is used to integrate with Salesforce, allowing developers to make API calls to interact with Salesforce data. The script discusses configuring Postman to work with Salesforce's API.

💡Connected App

A 'Connected App' in Salesforce is an application that is integrated with Salesforce, allowing users to connect to Salesforce services. The video script describes the process of creating a Connected App as a necessary step for integrating Salesforce with Postman, which includes setting up authentication and defining permissions.

💡API

API stands for Application Programming Interface, which is a set of rules and protocols for building and interacting with software applications. The video's theme revolves around using APIs to connect Salesforce with Postman, enabling developers to create, read, and manipulate data within Salesforce through Postman.

💡Authentication

Authentication is the process of verifying the identity of a user or system. In the script, authentication is crucial for the integration process, where Postman must authenticate with Salesforce to perform API calls. The video explains setting up authentication using a Connected App and obtaining an access token.

💡Callback URL

A Callback URL is the endpoint to which a user's browser is sent after successful authentication by a third-party system. In the script, setting a Callback URL is a step in creating a Connected App in Salesforce, specifying where users should be redirected post-authentication.

💡Scope

In the context of the video, 'scope' refers to the permissions or authorization levels granted to the user or application making API calls. The script mentions selecting a scope when creating a Connected App, which determines what actions the user can perform in Salesforce via Postman.

💡Client ID and Client Secret

Client ID and Client Secret are security credentials used in OAuth 2.0 for authorizing API access. The video script instructs viewers to obtain these credentials from the Salesforce Connected App to use in Postman for the integration process.

💡Security Token

A Security Token in Salesforce is an additional layer of security used for API authentication. The script explains how to generate and use a security token in Postman, appending it to the user's password to authenticate API requests to Salesforce.

💡Collection

In Postman, a 'Collection' is a group of related API requests. The video script describes creating a Collection in Postman to organize the API calls that will be made to Salesforce, which is part of setting up the integration.

💡Endpoint

An API endpoint is a URL that specifies a location for accessing a web service. The script discusses using various endpoints to interact with Salesforce objects via Postman, such as creating or retrieving account details.

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

play00:01

hello sfdc folks I hope everyone is

play00:03

doing good so today we are going to

play00:06

discuss about most widely used feature

play00:09

or functionality that is integrating

play00:12

Salesforce with Postman so many of times

play00:15

developer usually integrate Salesforce

play00:18

with Postman to develop and test the API

play00:22

related functionalities which is very

play00:24

useful for them so we'll know how to How

play00:27

we'll integrate these two systems we'll

play00:31

discuss the whole process starting from

play00:33

creating a Connected app to configuring

play00:36

in the postman and also we'll do some

play00:38

demo API calls from Postman as well so

play00:42

the first and foremost step to build

play00:44

this integration is to create a

play00:46

Connected app inside Salesforce so we'll

play00:49

go

play00:50

to

play00:52

our Connected app creation setup page so

play00:56

make sure you are on the classic UI of

play00:59

Salesforce or because creation of

play01:01

Connected app will be accessible via

play01:05

classic mode only so search for apps in

play01:09

in the search box click on apps and

play01:13

there you will find the option called

play01:16

connected apps here click on new to

play01:19

create a new Connected app this

play01:21

Connected app will be used for login

play01:24

purposes via this Connected app only the

play01:27

user will be able to log Salesforce or

play01:30

through Postman so this is the medium of

play01:33

login the first there will be some

play01:35

mandatory things to fill that we can

play01:37

definitely do that so let's get give the

play01:40

name of the Connected app as Postman

play01:44

int and the API name will be

play01:46

automatically populated contact email

play01:49

this is important because whenever if

play01:52

there is any failure in the login

play01:54

process or there is any restriction done

play01:58

during the integration procedure

play02:00

then the email will be sent to this

play02:02

particular email ID just to inform the

play02:05

person that hey this particular request

play02:08

has been failed or whatever be the

play02:09

reason the other things are optional

play02:12

that you can definitely configure later

play02:15

so the second thing that we'll do now is

play02:18

enable all settings this is really very

play02:20

important what sort of authorization you

play02:23

want to make via this Connected app so

play02:26

first option is call back URL this is

play02:29

nothing but the URL where the user will

play02:32

be redirected to after the

play02:34

authentication is successfully done so

play02:37

in order to make it simple I will just

play02:40

skip my domain URL as my call back URL

play02:44

so let me repeat it once again call back

play02:45

URL is nothing but it is the URL or the

play02:49

page where the user will be redirected

play02:52

to after he has

play02:54

successfully being

play02:56

authenticated from the third party

play02:58

system then the second option is the

play03:01

scope that we have to select what all

play03:03

permissions what all authent

play03:06

authorization that you want to give to

play03:08

that user who will be integrated he who

play03:11

will be making the API calls or whether

play03:13

he can create records or read records or

play03:17

he can also

play03:18

delete the metadata inside the

play03:21

Salesforce or so for now we'll give full

play03:25

access just for the training purpose we

play03:27

are giving full access but in real

play03:29

system real scenario it can be different

play03:33

out of all these options you can select

play03:35

multiple options as your wish now these

play03:38

are the only important uh information

play03:41

that you want to fill that you have to

play03:43

fill to create a Connected app so after

play03:46

you save it it will take 10 minutes to

play03:49

get it ready and that is why I have

play03:51

already created the Connected app with

play03:53

the same name just to save time it will

play03:56

take 10

play03:58

minutes so

play04:00

I already have this Postman integration

play04:03

in Connected app created so what all

play04:06

information you want to take from this

play04:08

Connected app in order to proceed with

play04:10

the configuration of the entire

play04:12

integration so you have to click on that

play04:14

manage consumer details this will give

play04:16

you client ID and client secret that

play04:19

will be used in our Postman while

play04:21

configuring the integration so let's

play04:23

click on this it will ask for

play04:26

the uh OTP which is access code just to

play04:29

see that

play04:32

information we'll provide

play04:38

that 3

play04:41

4 5 9 9

play04:46

6 now I should be able to see these two

play04:49

information consumer key is nothing but

play04:52

client ID and consumer secret is client

play04:55

secret we'll require this let let this

play04:58

page be open for now

play05:00

and yeah this is the this is all what

play05:03

Connected app part is now done the next

play05:07

thing we'll go to our Postman app to

play05:11

build the configuration between these

play05:13

two so before going there I would like

play05:16

to discuss one important very important

play05:18

thing there is a concept of security

play05:20

token inside Salesforce that you can

play05:23

generate from here click on your name

play05:25

click on my

play05:26

settings and here you can search for

play05:29

token

play05:30

see there is an option called reset my

play05:32

security token if you have not already

play05:34

reset your security token or you do not

play05:37

have it handy you can click on it and

play05:39

you'll receive an email con containing

play05:42

your security token that will be used

play05:45

when we will be configuring Postman to

play05:47

build the integration this is nothing

play05:49

but an additional information apart from

play05:52

your password to login into

play05:56

Salesforce for example if you want to

play05:58

login into Salesforce by entering

play05:59

username and password then this security

play06:02

token will be appended with your

play06:04

password just to provide your whole

play06:06

identity we'll use this so make sure you

play06:09

reset your security token and keep it

play06:11

handy somewhere let's go to our Postman

play06:15

now the first step here is to create a

play06:18

collection this is nothing but a folder

play06:20

it's a folder only which will contain

play06:23

all my requests that that I would make

play06:25

to my Salesforce org let's create a

play06:28

collection

play06:29

and name it as

play06:33

Postman to

play06:36

SF the type of this particular colle the

play06:39

type of authorization it is saying what

play06:41

type of authorization you want to use I

play06:43

will use o 2.0 which is the strongest

play06:48

authorization or we can say the

play06:50

strongest authentication

play06:52

process so there are few fields and

play06:56

information that we want to provide in

play06:57

order to authenticate our s

play07:00

first of all we have to authenticate

play07:02

ourself and then only we can make

play07:04

requests API request to our Salesforce

play07:07

or here it is configure new token so

play07:10

every time I will configure myself I

play07:13

will authorize myself it will create

play07:15

generate a an access token an access

play07:19

token will be used to login so let's

play07:21

start let's use the CR type as password

play07:25

credentials that means I want to

play07:27

authorize myself based on my user

play07:29

username and password along with

play07:31

security token let's give the token name

play07:34

as SF

play07:37

token here the first option access token

play07:40

URL from where this Postman fetch the

play07:43

access token where will it go I have to

play07:46

provide the URL of that particular uh

play07:49

box or something particular or where

play07:54

where the postman will go to request for

play07:56

the access token after providing all the

play07:58

identity so this URL is this one login.

play08:06

salesforce.com SLS Services

play08:11

2.0 token this is the URL where it goes

play08:15

and

play08:16

fetches the access token this is the

play08:19

first if it is a Sandbox or then it will

play08:21

be nothing but test. sales force instead

play08:24

of login. Sal Force but this will remain

play08:26

the same or to/ token

play08:29

next is we have to provide the client ID

play08:32

of that connected app which we are using

play08:34

to log

play08:37

in so I have

play08:39

already yeah open that page let's copy

play08:43

the consumer key

play08:45

here and go to our Connected app again

play08:49

paste it over here the second thing is

play08:51

client secret which

play08:54

is consumer

play08:57

secret we'll provide this information

play08:59

here as well and the username which user

play09:02

wants to log to the Salesforce

play09:04

or I have my username

play09:09

here and yeah then comes this very

play09:12

important part which is password this is

play09:13

not just your password but it is a

play09:16

combination of your password and the

play09:20

security token so let me show how it

play09:23

works so suppose your Salesforce off

play09:28

password is

play09:30

c 1 2

play09:34

3 at the

play09:38

rate and

play09:40

your security token that got generated

play09:43

is something like this XY zmo and so

play09:47

when you are configuring Postman you

play09:50

have to provide your password like this

play09:54

your normal password appended with your

play09:57

security token so make sure there is no

play10:00

space no underscore

play10:02

nothing between the password and the

play10:05

security token it will be one single

play10:09

word okay so here I already have my

play10:13

password to security token we'll provide

play10:16

it over here and the last thing is

play10:19

client authentication you select it as

play10:21

client set send client details in body

play10:25

now we'll get the access token after

play10:28

providing all the authentication

play10:30

information will generate the access

play10:33

token this is complete and after

play10:36

generating we just have to use this

play10:40

token okay so see this particular token

play10:43

field got

play10:45

automatically populated after I used it

play10:49

after generation when I clicked on use

play10:51

token this got automatically populated

play10:54

we'll save this now our authorization is

play10:58

done will start making API calls to our

play11:01

Salesforce or so what will I do is

play11:03

inside this folder I will create a

play11:06

request nothing but

play11:09

a API request so since the integration

play11:13

configuration is now done I will start

play11:15

making API calls so for the to make API

play11:20

calls we have to first so add a endpoint

play11:26

endpoint URL which particular request

play11:29

you want to

play11:32

make I will first try

play11:35

to create one account directly

play11:38

from Postman to

play11:41

Salesforce so in order to get more

play11:44

information of endpoints here is a you

play11:46

can refer to this article which contains

play11:49

all the in important URLs that you can

play11:52

call from the third party

play11:55

system which are these are actually some

play11:59

standard endpoint URLs that you can

play12:02

leverage so I will make use of this

play12:04

particular URL just to get the basic

play12:07

information of account

play12:09

object okay let me copy this is my

play12:12

domain URL appended with this Services

play12:17

SL API version and S

play12:24

objects okay I just copied the wrong

play12:27

thing maybe let me just select

play12:34

again after my domain URL I will this

play12:39

part and yeah so if I want to create an

play12:42

account so I will use Post Service post

play12:45

method and inside the body I'll provide

play12:48

the information of that account that is

play12:51

so like name and all other information

play12:54

that I want to provide while to create a

play12:57

account account

play13:02

created from

play13:05

API

play13:07

name so this should be the name of my

play13:14

account if I send this

play13:18

request okay what is it text plan is not

play13:24

supported if okay I you I have to use

play13:27

here Json so the body that I'm sending

play13:31

as an input parameter that should be in

play13:32

the form of Chason and not text see this

play13:36

account has been created in my or if I

play13:38

just copy the ID and go to my or

play13:42

directly just to

play13:45

see my newly created

play13:54

account I want to paste the ID but the

play13:57

URL is too long so now I can paste my ID

play14:00

over

play14:01

here H it and yeah see this account just

play14:06

got created the name is account created

play14:08

from API

play14:11

post great so this is see this just got

play14:16

created with my

play14:18

name and if I would have provided other

play14:21

values in the fields that would have

play14:23

that would have also been

play14:25

populated now let's make the second call

play14:27

so let let let's skip this one this

play14:30

request just for post

play14:35

account we'll create another request to

play14:38

get the Account

play14:47

Details okay use this same

play14:53

URL but this time with a different

play14:56

method which is get method and in order

play14:59

order to fetch the exact record account

play15:02

record we'll just provide the ID of that

play15:04

record so let me provide the ID here the

play15:08

URL is same just appending it with an ID

play15:12

let's get the details of this account

play15:14

see we got

play15:17

it the name and all other fields which

play15:20

are for

play15:23

now

play15:26

null so yeah this is how Postman got

play15:30

integrated with Salesforce and you can

play15:32

start making API calls you can create

play15:34

records get records you can do other

play15:37

different things thank you for watching

play15:41

goodbye

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
SalesforcePostmanAPI IntegrationDevelopmentTestingConnected AppAuthenticationSecurity TokenAPI CallsTech Tutorial
Benötigen Sie eine Zusammenfassung auf Englisch?