Hi, I'm trying to use the GET_REQUESTS operation to retrieve all the requests from an on-prem instance of ServiceDesk Plus. However, I'm a bit confused by the use of the 'from' and 'limit' parameters to create paging behaviour.
The behaviour I'm seeing is something like this:
Loop iteration |
From parameter value |
Limit parameter value |
First retrieved request workorderid |
Last retrieved request workorderid |
1 |
0 |
50 |
16871 |
16822 |
2 |
16772 |
50 |
None |
None |
I see that the records appear to be retrieved in reverse order, so I'm updating the 'from' parameter value to deal with this, but I don't understand why when I ask for requests beginning from 16772 I get no results back when I know there are requests both above and below this value.
I thought I'd repeat with a different start point other than zero to see what happened, so I started at 10000, and this is the result I got:
Loop iteration |
From parameter value |
Limit parameter value |
First retrieved request workorderid |
Last retrieved request workorderid |
1 |
10000 |
50 |
6310 |
6259 |
2 |
6209 |
50 |
10330 |
10281 |
3 |
10231 |
50 |
6070 |
6019 |
4 |
5969 |
50 |
10588 |
10530 |
In all of this, what I don't understand is why when I call GET_REQUESTS with a particular 'from' value parameter I seem to get results that don't relate to the 'from' value I've specified Specifically, if I start with a 'from' value of 16772 I get no results, even when I know there are requests both sides of this value (I can see them in the front end). If I make the call with a 'from' value of 10000, why do I get values back in the range of 6310 to 6259, and when I start with a 'from' value of 6209 why do I get results in the range 10330 to 10281.
Please, is anyone able to advise how the 'from' and 'limit' parameter values are interpreted in the API calls, and/or explain how I would retrieve a list of all the requests in the system given that it's noted elsewhere in these forums that the API call is limited to 100 records per call.
Any help much appreciated.
Thanks,
Jon