Standardize Open Cloud nextPageTokens

As a developer it’s currently confusing how to handle nextPageTokens across different endpoints. For example, https://apis.roblox.com/assets/v1/assets/{asset_id}/versions will not return a nextPageToken if there is not another page, which is expected behavior seen in legacy endpoints. However, the following endpoints will not return no nextPageToken if there is not another page, but will rather return a blank string (which doesn’t make a lot of sense). This makes it difficult to make a standard handler for Open Cloud, which is meant to offer more standardized behavior than legacy endpoints.

Endpoints:
https://apis.roblox.com/cloud/v2/groups/{group_id}/memberships
https://apis.roblox.com/cloud/v2/groups/{group_id}/roles
https://apis.roblox.com/cloud/v2/groups/{group_id}/join-requests
https://apis.roblox.com/cloud/v2/users/{user_id}/inventory-items
https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions
https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions:listLogs

Expected Behavior:

Unexpected Behavior:




3 Likes

Hey pop, thank you for pointing this out!

Discussed with the team internally and we agree that omitting nextPageToken on the final page is more ideal, but updating this behavior now would be a breaking change across the endpoints you mentioned above. If the nextPageToken is omitted instead of returned with a value of an empty string, scripts or apps looking for nextPageToken in the response may end up breaking.

In addition, we’ve already documented the empty string value as intended behavior in the Common Components section, so unfortunately it’s hard to justify making a breaking change here. We’ll keep this in mind though and omit nextPageToken for related endpoints moving forward.

As an aside, I did notice our documentation above doesn’t mention that the nextPageToken can be omitted entirely, so I’ve updated this page to mention that both behaviors can occur across the Open Cloud API surface.
(Old)


(New, should be rolling out soon)

2 Likes

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