How to get the Business Unit of an Agent

Hi,

I need to fetch the business unit (WFM) id of a specific Agent. I am logged in as an agent and I would expect to find the buid in the response of users\me ... but no luck....

Thanks!

Peter

After some reverse engineering I found:

https://api.mypurecloud.de/api/v2/workforcemanagement/managementunits/mine?expand=settings
https://api.mypurecloud.de/api/v2/workforcemanagement/businessunits/mine?expand=settings

These are not documented? Are they supported?

Regards,

Peter

Hi Peter,

The routes you found are fully supported and documented here:

https://developer.mypurecloud.com/api/rest/v2/workforcemanagement/

Specifically,

GET /api/v2/workforcemanagement/businessunits/{businessUnitId}

and

GET /api/v2/workforcemanagement/managementunits/{managementUnitId}

"mine" is actually a "magic" ID that works in many of our routes to call them against the management unit or business unit of the logged in user. The documention of the managementUnitID and businessUnitId path parameters states something along the lines of "The ID of the management unit, or 'mine' for the management unit of the logged-in user."

Also - The "expand=settings' query parameter should only be passed if you actually need the settings data for the objects. If you're just fetching the ID of the business unit or management unit you can drop that "expand" query parameter.

We do appreciate the question, and knowing that the first place you looked for that information was under "/users/me" is valuable feedback which we will take into consideration as we plan future enhancements to our WEM offering.

Thank for your reply, I just started playing around with the api and so far I really like it! :slight_smile:

1 Like

I'm glad. Please let us know if any other questions come up

Thanks a lot !!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.