0:06
hello everyone In this video we are
0:08
going to see how to activate or
0:12
deactivate Salesforce agent force agent
0:15
using REST API If you have a requirement
0:19
where you wanted to activate and
0:22
deactivate Salesforce agent force agent
0:25
uh using rest APIs then you can make use
0:28
of this video for your reference
0:34
activate and deactivate or enable and
0:37
disable agent force agent is your uh
0:44
URL and followed by the path should be
0:48
slash services/ data slash the version
0:52
number I'm using the current version
0:54
number 63 as a reference in this video
1:01
bot-en version slash the bot version id
1:05
So we have to get the version ID of the
1:08
bot slash activation We can do both get
1:12
request and as well as post request to
1:16
this same endpoint If you do a get
1:18
request then it will give us whether the
1:21
bot that is the agent force agent is
1:25
active or deactive whether it is enabled
1:29
or disabled So that information we will
1:31
get when we do a get request to this
1:34
endpoint If you do a post request with
1:38
the status parameter in the status
1:40
parameter you can either send active or
1:43
inactive If you send active then it will
1:46
enable or activate If you send inactive
1:49
as the status then it will deactivate or
1:52
disable the agent force
1:57
agent This is my uh agent force uh
2:01
service agent I'm making use of uh this
2:05
service agent for my messaging for uh
2:08
web implementation Let me refresh it
2:12
Currently it is inactive So if I click
2:19
activated So first we have to get the
2:22
access token So you have to create a
2:25
connected app in Salesforce Once the
2:27
connected app is there you can uh do a
2:32
post request to this my domain
2:37
URL/services/2 token I'm making use of
2:41
client credentials flow here So I'm
2:44
passing the consumer key and consumer
2:46
secret Using that I'm able to get
2:50
the access token using a simple script
2:53
I'm storing that in uh access agent
2:56
force access token global variable Next
3:00
if I do a get request to the
3:03
endpoint in order to get the version ID
3:07
you can get it from here when you open
3:11
the agent force agent
3:14
or you can do a query on bot version
3:18
object or entity So here you will be
3:21
able to get the version
3:23
ID So it should start with
3:27
0x9 So if I do a get request with the
3:31
header authorization as bearer space the
3:34
access token then I will be able to get
3:37
whether this particular version is
3:39
activated or not So currently it is not
3:42
activated It is in disabled or
3:45
deactivated If I do the same endpoint
3:48
with the post request with the status as
3:51
active let me and in the header I have
3:54
to pass authorization as the key and uh
3:57
in the value I have to pass barer space
4:00
the access token So since I'm sending
4:03
the parameter status as active it should
4:07
activate the agent force
4:09
agent So let's refresh it So it
4:14
it Now if you wanted to deactivate or
4:18
disable then we have to
4:27
status So now it deactivated or disabled
4:30
the agent force agent So currently it is
4:32
uh in active state If I refresh yeah it
4:35
is it disabled or deactivated it So I'm
4:38
able to see the activate button
4:42
Please check the video description In
4:44
the video description I have given my
4:46
blog post From the blog post you should
4:48
be able to get the endpoint for your
4:51
reference and also the SQL using which
4:54
we can find the bot version
5:05
ID I hope it was helpful
5:15
Thank you for watching