Legacy Dev Forum Posts

 View Only

Sign Up

GET /api/v2/stations?pageSize=100&pageNumber=101 response error 400

  • 1.  GET /api/v2/stations?pageSize=100&pageNumber=101 response error 400

    Posted 06-05-2025 18:27

    lyin | 2023-07-24 05:39:00 UTC | #1

    Hi all,

    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?

    Can someone help, and thank you in advance.


    tim.smith | 2023-07-24 13:24:24 UTC | #2

    This definitely sounds like a bug. Please open a case with Genesys Cloud Care to investigate further.


    John_Carnell | 2023-07-24 13:59:40 UTC | #3

    Hi Lyn,

    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


    John_Carnell | 2023-07-24 14:07:54 UTC | #4

    Hi Lyn,

    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


    lyin | 2023-07-25 00:15:37 UTC | #5

    Thank you very much for your quick reply.

    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 again


    lyin | 2023-07-26 07:16:41 UTC | #6

    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.

    Best regards


    system | 2023-08-26 07:17:32 UTC | #7

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 21122