CXone Reporting API v2 OData query for agent state history

Is there a clean way to query agent state history for the last 24 hours using the CXone Reporting API v2? I am constructing an OData filter on /api/v2/analytics/reporting/query with startTime and endTime parameters, but the response returns empty or throws a 400 Bad Request when I try to include specific agent IDs in the where clause. My current payload uses SELECT agentId, state FROM agentStateHistory WHERE startTime ge '2023-10-26T12:00:00Z' AND endTime le '2023-10-27T12:00:00Z'. Is the syntax for the time range or the entity reference incorrect?