How can I make a REST call from a client script?

kchoi
Kilo Explorer

I want to be able to send a REST POST message upon submission of a request form. I've already created the outbound REST message. Am I supposed to make an AJAX call from the client script to run a script include that makes the REST call? I would also like to pass the current user's username as a parameter in the REST call. I might just need clarification for something I've missed.

1 ACCEPTED SOLUTION

ghsrikanth
Tera Guru

Please check the community post, it will help you to resolve the issue -


Re: Is there any restriction for using REST message in client script of UI Page?



Hopefully it helps


View solution in original post

2 REPLIES 2

Robert Beeman
Kilo Sage

Hello,



You would use GlideAjax to call a Script Include that has the REST message in it. You could pass the username with g_form.userName: GlideUser (g user) - ServiceNow Wiki


ghsrikanth
Tera Guru

Please check the community post, it will help you to resolve the issue -


Re: Is there any restriction for using REST message in client script of UI Page?



Hopefully it helps