Show More Show Less
View Video Transcript
0:09
Hello everyone. In this video we are
0:11
going to see how to fetch Salesforce
0:14
conversation entries using conversation
0:18
data API. Previously in order to fetch
0:22
conversation entries we had an option to
0:26
make use of connect API in Salesforce to
0:30
retrieve it.
0:32
Now we have conversation data API which
0:36
is available from Salesforce using which
0:38
we can easily retrieve the conversation
0:40
entries.
0:42
In this video we are going to see how we
0:45
are going to make use of conversation
0:46
data API to fetch the conversation
0:49
entries.
0:52
The prerequisite for uh making use of uh
0:57
conversation uh uh data API is first
1:01
thing is we have to enable conversation
1:04
service API.
1:07
If we go to Salesforce setup in the
1:09
Salesforce setup, search for
1:12
conversation service APIs in the quick
1:15
find you can easily search for it. Open
1:19
the conversation service APIs and toggle
1:22
on conversation service APIs.
1:25
Once this is enabled, we have to create
1:29
external client app.
1:33
Make use of this Salesforce article
1:38
and follow all the steps that are shared
1:43
in this configure and external client
1:45
app section and create
1:49
the connected app previously called as
1:51
now it is external client app in
1:54
Salesforce. So create that configuration
1:57
in Salesforce setup. Once the external
2:00
client app is ready, you will be able to
2:03
get consumer key and also consumer
2:06
secret in Salesforce.
2:09
Once that is also done, then the first
2:14
step is we have to do a post request.
2:23
We have to do a post request to your
2:25
Salesforce my domain URL slashservices
2:30
slash services
2:34
/2 / token. So if you do a post request
2:38
to this endpoint with the help of client
2:42
ID and client secret from your external
2:45
client app with the grant type as client
2:49
credentials you will be able to get the
2:51
access token. Now let's send a request.
2:54
I'm able to get an access token.
2:58
Now in order to get the conversation
3:01
entries, we have to make a get request
3:05
to https
3:09
col/appi.salesforce.com/platform/engagement/
3:17
the current version is v1.0/ O /
3:21
conversation entries. In the param you
3:25
have to pass the conversation identifier
3:28
and in the header you have to pass
3:31
authorization as barrier space the
3:35
access token which you got it from the
3:39
previous post request.
3:42
Now let's see what is this conversation
3:45
identifier.
3:47
So after getting the access token, you
3:49
should uh do a get request and then you
3:52
should be able to see all the
3:55
conversation entries for this particular
3:58
conversation identifier.
4:02
Okay. Now let's see what is this
4:04
conversation identifier
4:06
for uh all the conversation that
4:10
happened between uh Salesforce or agent
4:14
force agent or human agent and also uh
4:17
with the um end users. We have all this
4:22
stored in an entity called messaging
4:25
session. So if you open a messaging
4:27
session record,
4:30
if you go to the details,
4:32
you should see conversation identifier.
4:36
From here, you should be able to get the
4:38
conversation identifier uh value for
4:41
this particular messaging session
4:42
record.
4:45
If you wanted to query the conversation
4:47
uh identifier then you can make use of
4:54
this particular SOQL.
5:02
So I'm not going to make use of Postman
5:05
to execute this query but in my
5:07
developer console I'm going to execute
5:09
this uh
5:12
query.
5:13
So here I'm able to get the messaging
5:15
session record ID from the URL.
5:20
So I'm going to get the
5:23
ID here. So I got the ID.
5:27
Now here I have to replace this ID.
5:33
So this is the conversation identifier
5:35
for this messaging session record.
5:42
Okay. So you can make use of this SOQL
5:44
also so that you will be able to get the
5:47
conversation identifier.
5:52
So just with the help of uh
5:56
conversation data API we were able to
5:58
fetch all the conversation entries for a
6:01
conversation identifier and the
6:03
conversation identifier is stored in
6:06
messaging session record.
6:12
Please check the video description. In
6:14
the video description, I have shared my
6:16
blog post. From the blog post, you
6:18
should be able to get the prerequisites,
6:23
the steps. I have also shared the
6:25
Salesforce help article so that you can
6:27
make use of uh this article to create
6:29
the external client app.
6:32
And I have also shared the SOQL using
6:35
which you should be able to get the
6:36
conversation identifier for a particular
6:38
messaging session record.
6:48
I hope it was helpful.
6:57
Thank you for watching.
#Internet Software
