We are using HTTP to get the list of stations in Genesys Cloud, we have over 20,000 stations
The requests are as follows (It is a series requests, i.e we sent request one after another):
/api/v2/stations?pageSize=100&pageNumber=1
......
/api/v2/stations?pageSize=100&pageNumber=100
For requests from pageNumber=1 to 100, they all return correct response code: 200, and we successfully retrieved data for 10,000 stations
However once increased one more as pageNumber=101, i.e.
/api/v2/stations?pageSize=100&pageNumber=101, the server always returns response code: 400 instead, there is absolutely no any other difference between request of pageNumber=101 and previous requests, except the pageNumber.
Is there any limitation of pageNumber in request? How can we fix this issue?
This is a limitation in the platform API because call uses our underlying ElasticSearch limits the number of search results to 10K total.
Can you provide the use case in which you need to pull back this many records. I have been passing them onto the dev team as I believe they are looking at alternate solutions.
Thanks,
John Carnell
Director, Developer Engagement
I did want to add that the name field does take a * search string so one workaround would be the search for all phone names that begin with a* process the results, then get all phone names that begin with b*. It makes the code a little bit more complicated but it will get around the 10K return limit because you are breaking your search space into smaller chunks.
Thanks,
John Carnell
Director, Developer Engagement
The reason that we want to extract all stations is:
We have 45,000 users, for each user, we would like to populate the user's station name (WebRTC name) by joining the user default station ID and the ID of corresponding station.
This is the main reason we need to extract all stations.
We also can use the "GET /api/v2/stations/[StationID] " API to extract station names for each user, however it would take a very long time because of the rate limit (300 request/per minute).
Currently, we would like to use * search string as suggested by John Carnell, it should work for our requirements.
Thank you, we did as you suggested, however just change a little bit, i.e. instead of searching name=a*, we are searching id for id=0*, id=1* ...... id=f*, and it works for our testing system, will try product line later.