Hey all,
So we’re hitting rate limits on the adherence export. We’ve got around 1200 agents and trying to pull adherence data for the last 7 days via the /api/v2/workforcemanagement/adherence endpoint. It’s… not going well. It’ll start, then throttle after a few hundred records, and the response doesn’t include all the adherence events for those agents. Just a partial set. Feels like something’s up with how we’re handling pagination or the endpoint itself.
The SDK we’re using is the official Node.js client, version 8.1.0. We’ve implemented retry logic with exponential backoff, but it’s still failing to grab all the data before the job times out. The initial request gets a 200, then subsequent requests start getting 429s. It’s not consistent - sometimes we get more data before the 429, sometimes less.
What’s frustrating is there’s no clear indication how many records are even available. No total count in the response or anything. Just pageCount, pageSize, currentPage. Which means we’re kinda guessing how many times to call the endpoint.
I tried limiting the pageSize to 50, thinking smaller batches would help, but it just increased the overall runtime. We’re also not filtering by anything - just trying to get all adherence records for all agents for that date range.
Here’s a sample request:
GET /api/v2/workforcemanagement/adherence?startDate=2024-02-21&endDate=2024-02-27&pageSize=50&pageNumber=1
And a sample response (truncated for brevity):
{
"adherenceEvents": [
{
"agentId": "agent123",
"adherenceType": "SCHEDULED",
"dateValue": "2024-02-22T10:00:00.000Z"
},
{
"agentId": "agent456",
"adherenceType": "NOT_SCHEDULED",
"dateValue": "2024-02-22T11:00:00.000Z"
}
],
"pageNumber": 1,
"pageSize": 50,
"pageCount": 30 // This number seems... optimistic.
}
We’ve tried:
- Decreasing
pageSizeto 50. - Implementing exponential backoff with retry logic (up to 5 retries).
- Checking our account’s rate limit status in the developer portal - no obvious issues.
- Verifying date range validity - no typos or invalid dates.
- Making sure our API keys are valid and have the correct permissions.
- Adding logging to see where the 429s are occurring and the size of responses.
Feels like this endpoint is just not built to handle a larger agent population. Anyone else running into this? Maybe there’s a better way to pull this data? Or is the pagination completely broken?