- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2015 02:56 AM
Hi,
I have a web application in which, I will have to list incidents for a chosen date or date range. I have this REST below url to which I want to pass date(s) as parameter.
https://instance.service-now.com/api/now/v1/table/incident?sysparm_display_value=true&active=true
Appreciate any help on this questions.
Thanks,
Vijay
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2015 03:07 AM
Hi Vijay,
Go to a list view of incidents in your instance, add conditions similar to those you would like in your query, right click the filter breadcrumbs and copy the url to get an idea of what the string should look like:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2015 03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2015 03:09 AM
Hi You can use this format
I would go with http://example.com/users/12345/bids?start=01-01-2012&end=01-31-2012.
https://instance.service-now.com/api/now/v1/table/incident?start=01-01-2012&end=01-31-2012
- There shouldn't be a slash before the query string.
- Avoid using slashes in the query string. It'll be easier that way.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2015 12:02 AM
Thank you, Jamie and Farhan for giving your time answering my query.
I have another question, related to aggregate REST api. I am trying to retrieve incidents grouped by - sys_created_on and severity with below URL
0: { "stats": { "count": "1"}
"groupby_fields": [2]
0: {
"value": "3 - Low"
"field": "severity"}
1: {
"value": "2009-04-30 00:34:45"
"field": "sys_created_on"
}
}
1: { "stats": {"count": "1"}
"groupby_fields": [2]
0: {
"value": "3 - Low"
"field": "severity" }
1: {
"value": "2009-09-09 19:25:40"
"field": "sys_created_on"
}
}
I am getting above output, however - I want to truncate the time part during aggregation, such that it groups for the date only (and not including the time). Appreciate your help on this.
Regards,
Vijay