Agent API - getAgentStatus

The getAgentStatus call is failing intermittently - returning a 400. We’re using the Node.js SDK v8.2.0, hitting /api/v2/agents/{agentId}/status. Agent IDs are being pulled directly from the Agent API getAgents response - so they’re valid.

{
 "error": "Bad Request",
 "message": "Invalid agent ID format. Agent ID must be a UUID.",
 "code": 400
}

It’s not a UUID issue - the IDs ARE UUIDs. The same ID succeeds sometimes, fails others. Something’s off with the validation on the CXone side.

  • I think maybe the agent ID is not really a UUID, even if it looks like one? In our system, sometimes the agent ID looks very similar to a UUID but it is actually a string number. We have the problem too, sometimes the API is not working when the ID is not exactly what it wants.
  • Also, can you check if the agent is actually logged in? If the agent is in ‘Not Ready’ status, maybe the API is not returning the status correctly. Is ‘Not Ready’ the same as ‘offline’? I’m not very sure about the status names.
  • It could be the SDK, also. Is there maybe a setting in the SDK that is doing something wrong with the agent ID? It’s like, the SDK is converting the ID to something that the API does not understand. I wonder…
  • You said you pull the IDs from the ‘getAgents’ call? Is that call returning the IDs in the same format every time? We have the problem sometimes when the format is changing.
{
 "agent_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
 "status": "READY"
}

That’s right, the agent ID must be a UUID-but the CXone is very sensitive to the casing. We saw this issue when migrating from a system that was generating IDs with mixed-case hexadecimal characters - it fails validation because it expects lowercase only. Also check the status field - it can be READY, NOT_READY, OFFLINE, and others-the won’t accept anything else.

1 Like