Genesys JS SDK Queue API returns truncated list across divisions

The getQueues method in the Genesys Cloud JavaScript SDK only returns queues from the default division, even when expand is set. I need to fetch queues from multiple specific divisions for our adherence reporting, but the SDK doesn’t seem to support a divisionIds filter in the query params like the REST API does. Is there a way to pass multiple division IDs to the SDK client, or do I have to loop through divisions manually?

You’re probably hitting the default pagination limit. The SDK doesn’t magically fetch everything unless you tell it to. The getQueues method supports divisionIds just fine, but you have to pass it as an array in the optional params object.

Here’s the minimal repro:

const { PureCloudPlatformClientV2 } = require('@genesyscloud/genesyscloud');

const platformClient = PureCloudPlatformClientV2.create();

async function fetchQueues() {
 try {
 await platformClient.loginOAuth.clientCredentials('my_client_id', 'my_client_secret');
 
 const divisionIds = ['division_id_1', 'division_id_2'];
 
 // Pass divisionIds and set limit to max allowed if you need more than 25
 const queues = await platformClient.queueApi.getQueues({
 divisionIds: divisionIds,
 limit: 200
 });
 
 console.log(queues.entities.length);
 } catch (e) {
 console.error(e);
 }
}

fetchQueues();

If you’re still getting truncated results, check if you’re hitting the 200 item hard limit. You’ll need to handle the nextPage cursor manually if the count exceeds that. The SDK doesn’t auto-paginate for you in this specific call.