REST API get only records updated after certain time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 10:05 PM
How to write write an API call to get records updated after certain date/time? For example
https://tesla.service-now.com/api/now/table/incident?sysparm_query=sys_updated_on>"2018-06-01"
- Labels:
-
Analytics and Reports
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 01:14 PM
You can OOB table api . You can also create a scripted rest api and pass a parameter for the date/time. You can then do the gliderecord query for the records updated after that date/time and pass that in the response object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2018 09:55 PM
I think i'm already using Out of box incident table api but couldn't find a way to run greater than date query. Can you please elaborate more on scripted rest api approach? I didn't get that.
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2018 12:14 AM
This should work
var request = new sn_ws.RESTMessageV2(); request.setEndpoint('https://instance.service-now.com/api/now/table/incident?sysparm_query=sys_created_on%3Ejavascript%3Ags.dateGenerate('2018-01-01'%2C'00%3A00%3A00')); request.setHttpMethod('GET');
you can use REST API Explorer (search for that in the navigator)
There you can play around with div REST API's
Query is copied from a list of incidents with created on after a date that includes HH:mm:ss
sys_created_on>javascript:gs.dateGenerate('2018-01-01', '00:00:00')