Hello everyone. In this video, we are
going to see how to retrieve or get
estimated wait time
when implementing Salesforce messaging
for web using custom client.
In order to access access Salesforce
messaging for web using rest APIs then
we have to create embedded service
deployment
of type custom client for the messaging
uh for web.
If you haven't done the custom client
embedded service deployment creation
before and then if you are getting
started now, please make sure you are
going through this uh link for your
reference and then uh you create a
messaging uh channel and also when you
create the embedded service deployment
uh make sure you are uh selecting a
custom client. So for a custom client
this is how the embedded service
deployment will be uh looking like. It
will have pre-hat push notifications and
uh code snippet. Even if you look at the
code snippet, we will have only few
information like organization ID, what
is the developer name and URL because
all this information we do uh use it in
the rest API calls.
Whenever we implement customuhat
client and uh if we use Salesforce
messaging for web endpoints for the rest
API calls,
we might have an use case where we
wanted to display estimated wait time
in the messaging uh channel when you
created the messaging channel for the
messaging for web implementation.
So this is the messaging channel I
created.
I cannot check it from here. So click
edit
and uh make sure
estimated weight time is enabled. So
show estimated weight time checkbox
should be enabled. And then you have to
click save
and then the respective messaging for uh
web embedded service deployment should
be published. Once you make any changes
in your messaging channel, make sure to
publish your embedded service
deployment. Once this is done,
so this is the uh flow.
First we create uh we do a post request
to get the access token. So similarly
I'm getting the access token. I have a
script which stores the access token in
this variable. Next I'm creating a UU ID
so that that will be stored in this
variable.
So this is going to be my conversation
ID.
Next we have to uh create the
conversation. So now the conversation is
ready. The next thing is you have to
make use of list conversation entries
endpoint to find the estimated wait
time. So if you do a call to this
endpoint with your conversation ID,
this is the conversation entries.
Look for entry type as routing result in
the routing result. Uh entry type
check for the entry payload. In the
entry payload check for estimated weight
time under estimated weight time check
estimated weight time in seconds. So
here
is uh estimated weight time is requested
is true. Why it is true is in the
messaging channel we enabled show
estimated wait time. So if you have a
use case to find the estimated wait time
then you can make use of this list
conversation entries endpoint once the
conversation is created so that you will
be able to check the estimated wait
time.
Let me close the conversation.
Yeah,
please check the video description. In
the video description, I have shared my
blog post. From the blog post, you
should be able to get the steps whatever
we discussed in this video for your
reference.
I hope it was helpful.
Thank you for watching.