- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 09:12 AM
All,
To start with, I'm not sure if this is right forum to post my question!
I'm experimenting with Service NOW REST API and am stuck in a situation where I need to GET incidents created ON and/or AFTER a certain date. I'm not sure how to form the REST URL since normal ways of LESS THAN or GREATER THAN with proper date format are not working.
The following URL gives me the correct incident registered on the particular date i.e. opened_at=2013-04-18+06:37:37
But I need to get ALL the incidents OPENED AFTER this date... I've tries >, %3E%3D, >= and all combinations but am getting "No record found" message.
I've searched High & Low on ServiceNOW Wiki & other forums but no lead till now...
Please do let me know how this can be done...
Thanks in advance...
S. Gatade
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 09:23 AM
When I use the REST API Explorer, it shows me this:
var request = new sn_ws.RESTMessageV2(); request.setEndpoint('https://dev14066.service-now.com/api/now/table/incident?sysparm_query=sys_created_on%3E%3Djavascript%3Ags.dateGenerate('2015-12-09'%2C'14%3A05%3A30')&sysparm_limit=10'); request.setHttpMethod('GET');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2016 09:26 PM
You have to ASCII Encode it HTML URL Encoding Reference
https://<server instance/api/now/table/cmdb_rel_ci?sysparm_limit=10&sysparm_query=active%3Dtrue%5Esys_updated_on%3Ejavascript%3Ags.daysAgoEnd%28100%29