REST API endpoint for search on incident ticket

RandyK
Mega Contributor

When doing a REST API search for incidents I get an HTTP error 400
Doing 

search_incident_endpoint='/api/now/table/incident?sysparm_query=active%3Dtrue%5EORDERBYDESCnumber%5Estate<3%5E%5Estate<3%5Eshort_description%5Esysparm_limit=10'

"Setting request endpoint to /api/now/table/incident?sysparm_query=active%3Dtrue%5EORDERBYDESCnumber%short_descriptionLIKEBH1150#V%5Esysparm_limit=10" 

 

I think it doesn't like the BH1150#V (# in jobname)  It works fine without a # sign in logic.....

 

 

1 ACCEPTED SOLUTION

Perfect .  Thanks Logon

View solution in original post

4 REPLIES 4

Logan Poynter
Mega Sage
Mega Sage

Try using %23 so that it is properly url encoded.

 

Please mark helpful/correct if this has helped you. 

 

Thanks,

Logan

Perfect .  Thanks Logon

Hitoshi Ozawa
Giga Sage
Giga Sage

It's possible to get the url by using REST API Explorer.

Paste the query into sysparm_query field and click on the "Send" button

find_real_file.png

URL to use will appear further down the page in the Request section.

find_real_file.png

 

https://developer.servicenow.com/dev.do#!/learn/courses/quebec/app_store_learnv2_rest_quebec_rest_in...

Thank you for the Info .. that worked great!