Legacy Dev Forum Posts

 View Only

Sign Up

How to get the Business Unit of an Agent

  • 1.  How to get the Business Unit of an Agent

    Posted 06-05-2025 18:02

    xember | 2021-03-14 15:42:24 UTC | #1

    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


    xember | 2021-03-14 16:24:15 UTC | #2

    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


    brian.trezise | 2021-03-18 14:55:54 UTC | #3

    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.


    xember | 2021-03-23 17:15:52 UTC | #4

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


    brian.trezise | 2021-03-26 13:12:58 UTC | #5

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


    xember | 2021-03-26 13:15:18 UTC | #6

    Thanks a lot !!


    system | 2021-04-26 13:15:19 UTC | #7

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


    This post was migrated from the old Developer Forum.

    ref: 10269