I’ve been staring at this for an hour and it’s driving me up the wall. I’m building a simple Node.js service to fetch queue details using the genesys-cloud SDK. The token generation works fine, I can see the scopes in the JWT payload, but the actual API call keeps failing with a 403.
The docs state: “To access queue data, the application must have the routing:queue:read scope.” I’ve confirmed this scope is present in the token. Here’s the relevant code snippet:
const { PlatformClient } = require('@genesyscloud/genesyscloud');
const client = PlatformClient.init({
clientId: process.env.GENESYS_CLIENT_ID,
clientSecret: process.env.GENESYS_CLIENT_SECRET,
baseUrl: 'https://api.mypurecloud.com'
});
async function fetchQueues() {
try {
// Token is valid and contains routing:queue:read
const queues = await client.RoutingApi.getQueues({
pageSize: 25,
includeEmpty: true
});
console.log(queues);
} catch (error) {
console.error('Error fetching queues:', error.response.status, error.response.data);
}
}
The error response is:
{
"message": "Forbidden",
"code": "403",
"status": "Forbidden"
}
I’ve double-checked the client credentials. They have the routing:queue:read scope assigned in the Genesys Cloud admin console under Applications. The token introspection endpoint confirms the scope is active. I even tried regenerating the client secret, just in case.
Is there another scope I’m missing? The docs don’t mention anything else for basic queue retrieval. I’ve also checked the user role associated with the client credentials, and it has the “Routing Supervisor” role, which should definitely allow reading queues.
What am I missing here?