Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Powershell API example

JBrennan
Giga Contributor

Hi All,

It appears that the Powershell example inside the REST API Explorer tab is malformed, specifically:

# Specify request body

{request.body ? "$body = \"" :""}}{}"

This line is not valid Powershell syntax. Can anybody help me out as to what this should be?

find_real_file.png

10 REPLIES 10

Harsh Vardhan
Mega Patron
Mega Patron

HI Jeremy,



Please check the link below.



Service Now REST API and PowerShell « TechOnTip Weblog


Hi Harsh,


Thank you very much for taking the time to respond, I did come across that article but it doesn't resolve my requestion.



The example actually works fine however the formatting of the body is not great and that is assumedly what the Service-Now engineers were attempting to fix with that ill-formatted line


Hi Jeremy,



please check the thread below. i did not work on powershell   but i can try and get back to you



PowerShell Explore REST Api


tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Jeremy,


Could you supply a screenshot of the config defined in Explorer GUI? The Powershell code would be derived from that.


Also could you post the curl code sample that is generated.


Does the get succeed when invoked from the Explorer GUI?



The intention is that the above info will narrow down where things are going wrong.



If the reply was informational, please like, mark as helpful or mark as correct!