Hi Nadir,
My understanding is that if you already have the User ID, you don't need to start with the Queue ID.
You can first retrieve the user's Management Unit using:
GET /api/v2/workforcemanagement/agents/{userId}/managementunit
From there, you can determine the associated Business Unit ID and use it with:
POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/agentschedules/search
passing the same User ID in userIds along with the required date range.
So essentially:
User ID → Management Unit → Business Unit → Schedule
A previous discussion about historical agent activity shows the same User ID → Management Unit → Business Unit → schedule lookup approach, which may be useful for your scenario:
https://community.genesys.com/discussion/historical-agent-activity-api
Hope this helps!
------------------------------
Phaneendra
Technical Solutions Consultant
------------------------------