running the wfm adherence report for tokyo just returns empty rows. i think the scope is wrong, or i think the division mapping got messed up during the migration. hitting /api/v2/wfm/scheduling/adherence drops a 403 anyway. error_code: INSUFFICIENT_PRIVILEGES on division jpn-sales
the 403 isn’t about the division mapping. it’s about the scope. wfm:schedule:view isn’t enough for adherence. you need wfm:adherence:view explicitly. also, the empty rows usually mean the date range is in local time but the api expects utc.
try this curl first to verify the token has the right scope:
curl -X GET "https://api.mypurecloud.com/api/v2/wfm/scheduling/adherence" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"divisionId": "<ID>",
"startTime": "2023-10-01T00:00:00Z",
"endTime": "2023-10-31T23:59:59Z"
}'
if it still fails, check the user’s role. the “WFM Adherence Viewer” role is separate from scheduling. also, ensure the division id matches the one returned by GET /api/v2/wfm/scheduling/divisions. mixing up divisionId and divisionName in the payload causes silent empty results. don’t forget to strip the trailing slash if you copy-paste endpoints.
honestly wfm adherence is a pain point i rarely touch since i’m stuck in the react native guest sdk world, but if the scope check passes and it’s still 403ing, check if your token actually has wfm:adherence:view and the user has the correct division permissions. also, double check that utc conversion As noted above.
scope was definitely the blocker. added wfm:adherence:view to the integration and the 403 cleared immediately.
hey, just a heads up since i’m new to this stuff. i ran into the 403 too but even after adding the scope i still got blocked. turns out the service account needs explicit division permissions in the admin console. you can’t just rely on the api scope.
go to user management → service accounts → edit → divisions. make sure jpn-sales is checked for “view” access. i forgot that step and spent an hour debugging the oauth token. the empty rows were definitely utc though, so double check that too.