- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2018 11:30 PM
Hi All,
How can we create outbound REST web-service to allow third party app, to retrieve only specific set of records(like 10 records) and at 3rd party side when user hit Next, then provide/send next 10 records? is it possible to achieve?
Many thanks in Advance
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2018 11:50 PM
Hi Mason,
There are two ways of achieving this
1. In first approach, third party will have to change the parameter with incremented number
You can make use of the sysparm_offset and sysparm_limit parameters.
For example: If you want to retrieve 10 records (sysparm_limit=10) in the record set starting from the beginning (sysparm_offset=0) of the record set.
/api/now/table/<tablename>?sysparm_limit=10&sysparm_offset=0
Then for next 10 records, you would simply increment the value of sysparm_offset by the value of your sysparm_limit
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=10
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=20
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=30
.
.
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=n
2. Create a Scriptted rest API and on each call you can store the record set in a log table and send only those records those are not avaible in the log table.
Hope this helps!
Regards,
Ujjawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2018 11:45 PM
Hello,
The third party need to send additional parameters to limit the result set and this could be achieved by sending the sysparm_limit & sysparm_offset in the endpoint URL.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2018 11:50 PM
For example the following will retrieve 5 records (sysparm_limit=5) in the record set starting from the beginning (sysparm_offset=0) of the record set.
/api/now/v1/table/incident?sysparm_limit=5&sysparm_offset=0&sysparm_query=active=true
The get the next 5 records, you would simply increment the value of sysparm_offset by the value of your sysparm_limit
/api/now/v1/table/incident?sysparm_limit=5&sysparm_offset=5&sysparm_query=active=true
You will also get a URL in the response Header that provides a link to first,prev,next and last pages based on values used for sysparm_offset and sysparm_limit. You can also make use of this link if required.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2018 11:50 PM
Hi Mason,
There are two ways of achieving this
1. In first approach, third party will have to change the parameter with incremented number
You can make use of the sysparm_offset and sysparm_limit parameters.
For example: If you want to retrieve 10 records (sysparm_limit=10) in the record set starting from the beginning (sysparm_offset=0) of the record set.
/api/now/table/<tablename>?sysparm_limit=10&sysparm_offset=0
Then for next 10 records, you would simply increment the value of sysparm_offset by the value of your sysparm_limit
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=10
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=20
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=30
.
.
/api/now/table/tablename?sysparm_limit=10&sysparm_offset=n
2. Create a Scriptted rest API and on each call you can store the record set in a log table and send only those records those are not avaible in the log table.
Hope this helps!
Regards,
Ujjawal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2018 02:18 AM
Hi Ujjawal,
Can you guide me with scripted API syntax that was mentioned in 2)
Thanks
Sailesh