Having some issues getting my configuration to work. i have a node js script using the genesys cloud platform sdk to control agent states during load testing. i can successfully initiate calls and handle basic events, but muting the agent mic programmatically fails silently or throws a generic error.
here is the relevant snippet:
const { Client } = require('@genesyscloud/genesyscloud');
async function muteAgent(agentId) {
const client = new Client();
await client.login();
try {
const response = await client.platformClient.calling.muteParticipant(agentId, { mute: true });
console.log('mute response:', response);
} catch (err) {
console.error('mute failed:', err);
}
}
the error i get is:
Error: Request failed with status code 400
the json payload i am sending seems correct based on the docs:
{ "mute": true }
i have verified the agent is on an active call via the /api/v2/telephony/providers/edge/calls endpoint. the call status is ‘connected’. am i missing a header or is the endpoint path wrong? i need this to work for my k6 test scenarios where we simulate agent hold/mute cycles. any help appreciated.