News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
GLIP - Team List With Page Token Not Working
Tags: rest api
Sep 3, 2020 at 11:07pm   •   2 replies  •  0 likes
Scott McCain

I am trying to get all the teams associated with a particular login. I know there are more than 250 teams in this example. When I use either the .Net SDK or calling the endpoint directly I never receive a nextPageToken value (even though there are far more than 250 teams). I do receive a prevPageToken, but if I assign that to the pageToken of the query parameters I receive an error:

RestException: Response:
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Connection: keep-alive
  RCRequestId: 653444c4-ee73-11ea-aaee-0050568c8430
  X-Request-Id: reqId:653444c4-ee73-11ea-aaee-0050568c8430;accId:2195291011;extId:2557875011
  X-HLB-Server: sjc01-c01-hlb32
  X-HLB-Connection: 50027820
  X-HLB-RequestId: df65aa11c9c684941c503f539eb3a7c4
  X-HLB-Upstream-Server: 10.13.22.98:54301
  X-HLB-Upstream-Status: 400
  X-Rate-Limit-Group: medium
  X-Rate-Limit-Limit: 60
  X-Rate-Limit-Remaining: 59
  X-Rate-Limit-Window: 60
  RoutingKey: IAD01P04
  Date: Fri, 04 Sep 2020 05:56:37 GMT
  ETag: W/"74-Qo1hxy00ZvJ+5ivUzGjLpg"
  Server: nginx
  Content-Length: 116
  Content-Type: application/json; charset=utf-8
}
Content: {"errors":[{"errorCode":"CMN-101","message":"Parameter [pageToken] value is invalid.","parameterName":"pageToken"}]}

Request:
Method: GET, RequestUri: 'https://platform.ringcentral.com/restapi/v1.0/glip/teams?pageToken=H4sIAAAAAAACAx2MSwqFMBAE79LrWWhCnLw5h7uQRdAIAX+YKIh4d31uelFF9YUDUhPKtyPkQuoh2jRcW6vZKsIRxj2+3rBSVivWbH43IfdfkwcIui2Gkpa5TVMEYevei4owZIhzKOf6p2kGObQxTPDe3w9OfmAFewAAAA==', Version: 1.1, Content: <null>, Headers:
{
  X-User-Agent: Unknown/0.0.1 RingCentral.Net/4.1.0
  Authorization: Bearer XXXREDACTEDXXX
 }


Here is my code for reference:

            var navigation = new GlipNavigationInfo();
            do
            {
                   var queryParameters = new ListGlipTeamsParameters { pageToken = navigation.nextPageToken };  // nextPageToken is always null, and using prevPageToken results in an error

                var teams = _client.Restapi().Glip().Teams().List(queryParameters).Result;
                foreach (var team in teams.records)
                {
                    yield return team;
                }

                navigation = teams.navigation;

            } while (navigation.nextPageToken != null);  // nextPageToken is always null, and using prevPageToken results in an error


2 Answers
answered on Nov 5, 2020 at 7:20pm  

@Phong Vu

Using prevPageToken in the request results in error as specified in this post. How to deal with this?


 0
answered on Sep 4, 2020 at 11:09am  

It is a reversed list with new first and oldest last. So use the prevPageToken to read "next" block.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us