Send Post request to Uipath Bot from Service Now

Hi,
I have a requirement where I need to call (using rest api) uipath bot from service now without using uipath spoke.

I know that I can create script on service now and which will first authenticate and then start job using unattended bot on orchestrator.
Now, the bot is on automation cloud orchestrator (our organization’s cloud orchestrator), so content type of the request body for access token will be different and it will be “application/x-www-form-urlencoded”

So what will be changes that must be included in script so I can send the post request for accessing token?

Need some suggestion on this.
Thanks.

1 Like

Hey @Debartha_Mitra_DE

You already identified it as form-encoded that’s the change right ?

Thanks
#nK

Yes, accessing the token using POST request (in cloud orch api) the content type should be x-www-form-urlencoded, for that I need to know the script.
I did script for JSON type but never did for x-www-form-urlencoded, so need help in this.

1 Like

Okay got it.

Which language you are looking for JavaScript?

Thanks
#nK

yeah in JavaScript

1 Like

Hey @Debartha_Mitra_DE

I guess you can use postman for the same.

And perform the request from postman import the javascript code which will be much easier.

Hope this helps.

Thanks
#nK

Hi

Did we check with this video

I think he has got good number of videos on same topic
Have a view on it for more ideas

Cheers @Debartha_Mitra_DE

1 Like

Thanks for sharing, I have done the similar approach, created script and that script will be called if there is any business rule change.

His script is for only for json request body while accessing the token, but to use the cloud orch. api we need to use “x-www-form-urlencoded” request body (while accessing the token) and for that script will be different.

Is there any piece of code that you have or any suggestion on that ?

well, I need to use the servicenow interface and need to implement the code over there only, not from postman.

1 Like

Hey @Debartha_Mitra_DE

Yes you are right. I’m pointing the same.

Once you build the request in postman, just hit that code button to get your javascript code for the same.

Hope this helps

Thanks
#nK

Check this out

Cheers @Debartha_Mitra_DE