# How can I get the userid to use to AssignUserToBO?

**URL:** <https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276>\
**Category:** Windows\
**Created:** [March 23, 2022, 6:27am UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276 "2022-03-23T06:27:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [March 23, 2022, 6:27am UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/1 "2022-03-23T06:27:19Z")

</div>

**Description**

I want to add a user to the BO room.  
I wrote a program

```auto
//get helper
ZOOM_SDK_NAMESPACE::IMeetingService* meetingService = SDKInterfaceWrap::GetInst().GetMeetingService();
ZOOMSDK::IMeetingBOController* breakoutRoomController = meetingService->GetMeetingBOController();
auto BOCreatorHelper = breakoutRoomController->GetBOCreatorHelper();

//getUserId
IUserInfo testuser = getSpecificUser(someconditions) //getSpecificUser is our function
wchar_t *userid = itowchar(testuser->GetUserID()); //itowchar is our function. unsignd int to wchar_t

result = BOCreatorHelper->AssignUserToBO(userid, BO_ID); // <- return false

```

i can get userid. (ex. userid : 16781312)

but AssignUserToBO return false.  
so, i check BODataHelper-\>GetUnassginedUserList value

```auto
    ZOOMSDK::IList<const wchar_t*>* unassignedUserList = BODataHelper->GetUnassginedUserList();
    for (int i = 0; i < unassignedUserList->GetCount(); i++)
    {
        const wchar_t* strUserID = unassignedUserList->GetItem(i);
    }

```

strUserID is not int (ex. strUserID : 77b3a0540edc0b900a8b19c795f253c6)

how to assign a user to bo?  
how to get strUserID by userinfo?

**Which Windows Meeting SDK version?**  
v5.9.3.3191

**Device (please complete the following information):**

- Device:  
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz 2.10 GH  
16.0 GB RAM  
1T SSD
- OS: Windows 10 Pro 64bit

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 24, 2022, 9:23pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/2 "2022-03-24T21:23:54Z")

</div>

Hi @hanataba,

Before you can use the individual BO interfaces, you must first receive a callback indicating that the current user has the right privileges. These callbacks can be found in [`IMeetingBOControllerEvent`](https://marketplacefront.zoom.us/sdk/meeting/windows/class_i_meeting_b_o_controller_event.html). For example, [`onHasCreatorRightsNotification`](https://marketplacefront.zoom.us/sdk/meeting/windows/class_i_meeting_b_o_controller_event.html#a0d20e7bd2a043e3b50bcce2947ec24d3) indicates that you can now create a breakout room through `IBOCreator`.

Thanks!

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [March 25, 2022, 7:52pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/3 "2022-03-25T19:52:25Z")

</div>

thank you reply @jon.lieblich.

i add IMeetingBOControllerEvent and setEvent.

but it did not call.  
any \_\_debugbreak() did not stop.

At the time of testing, i have confirmed that the role is “HOST”.

and Helpers such as BOCreatorHelper have been able to get instances. Not null.

```auto
bool startBO(std::vector<Tender::BOSetting> rooms) {

    class MyMeetingBOControllerEvent : public ZOOM_SDK_NAMESPACE::IMeetingBOControllerEvent
    {
    public:
        MyMeetingBOControllerEvent() = default;
        ~MyMeetingBOControllerEvent() = default;

         void onHasCreatorRightsNotification(ZOOM_SDK_NAMESPACE::IBOCreator* pCreatorObj) {
             __debugbreak();
         }

         void onHasAdminRightsNotification(ZOOM_SDK_NAMESPACE::IBOAdmin* pAdminObj) {
             __debugbreak();
         }

         void onHasAssistantRightsNotification(ZOOM_SDK_NAMESPACE::IBOAssistant* pAssistantObj) {
             __debugbreak();
         }

         void onHasAttendeeRightsNotification(ZOOM_SDK_NAMESPACE::IBOAttendee* pAttendeeObj) {
             __debugbreak();
         }

         void onHasDataHelperRightsNotification(ZOOM_SDK_NAMESPACE::IBOData* pDataHelperObj) {
             __debugbreak();
         }

         void onLostCreatorRightsNotification() {
             __debugbreak();
         }

         void onLostAdminRightsNotification() {
             __debugbreak();
         }

         void onLostAssistantRightsNotification() {
             __debugbreak();
         }

         void onLostAttendeeRightsNotification() {
             __debugbreak();
         }

         void onLostDataHelperRightsNotification() {
             __debugbreak();
         }

         void onNewBroadcastMessageReceived(const wchar_t* strMsg, unsigned int nSenderID) {
             __debugbreak();
         }

         void onBOStopCountDown(unsigned int nSeconds) {
             __debugbreak();
         }

         void onHostInviteReturnToMainSession(const wchar_t* strName, ZOOM_SDK_NAMESPACE::IReturnToMainSessionHandler* handler) {
             __debugbreak();
         }

         void onBOStatusChanged(ZOOM_SDK_NAMESPACE::BO_STATUS eStatus) {
             __debugbreak();
         }
    };

    ZOOM_SDK_NAMESPACE::IMeetingService* meetingService = SDKInterfaceWrap::GetInst().GetMeetingService();
    ZOOMSDK::IMeetingBOController* breakoutRoomController = meetingService->GetMeetingBOController();

    MyMeetingBOControllerEvent e;
    breakoutRoomController->SetEvent(&e);

    if (!breakoutRoomController)
    {
        __debugbreak();
        onBOError("cant start bo");
        return false;
    }

    //make helpers
    auto BOAdmin = breakoutRoomController->GetBOAdminHelper();
    auto BOAssistantHelper = breakoutRoomController->GetBOAssistantHelper();
    auto BOAttedeeHelper = breakoutRoomController->GetBOAttedeeHelper();
    auto BOCreatorHelper = breakoutRoomController->GetBOCreatorHelper();
    auto BOBatchCreatorHelper = BOCreatorHelper->GetBatchCreateBOHelper();
    auto BODataHelper = breakoutRoomController->GetBODataHelper();

    ......long time process
 

```

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 28, 2022, 5:24pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/4 "2022-03-28T17:24:29Z")

</div>

Hi @hanataba,

At what point is this code being executed? If the helper classes are already available, it seems likely that `SetEvent` is being called after the privileges have already been received.

Thanks!

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [March 28, 2022, 6:37pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/5 "2022-03-28T18:37:17Z")

</div>

changeed to start BO Start after receiving onHasCreatorRightsNotification and onBOCreateSuccess.

this code is success. can open BO.

```auto
class MyMeetingBOControllerEvent : public ZOOM_SDK_NAMESPACE::IMeetingBOControllerEvent
{
public:
    ZOOM_SDK_NAMESPACE::IBOCreator* mypCreatorObj;
    ZOOM_SDK_NAMESPACE::IBOAdmin* mypAdminObj;
    ZOOM_SDK_NAMESPACE::IBOData* mypDataHelperObj;

    static MyMeetingBOControllerEvent& GetInstance(){
        static MyMeetingBOControllerEvent instance;
        return instance;
    }

    MyMeetingBOControllerEvent();
    ~MyMeetingBOControllerEvent();
    void MyMeetingBOControllerEvent::onHasCreatorRightsNotification(ZOOM_SDK_NAMESPACE::IBOCreator* pCreatorObj) {
        mypCreatorObj = pCreatorObj;
    }
    void MyMeetingBOControllerEvent::onHasAdminRightsNotification(ZOOM_SDK_NAMESPACE::IBOAdmin* pAdminObj) {
        mypAdminObj = pAdminObj;
    }
    void MyMeetingBOControllerEvent::onHasDataHelperRightsNotification(ZOOM_SDK_NAMESPACE::IBOData* pDataHelperObj) {
        mypDataHelperObj = pDataHelperObj;
    }
};

class MyBOCreatorEvent : public ZOOM_SDK_NAMESPACE::IBOCreatorEvent
{
public:
    static MyBOCreatorEvent& GetInstance(){
        static MyMeetingBOControllerEvent instance;
        return instance;
    }

    MyBOCreatorEvent() {}
    ~MyBOCreatorEvent() {}
    void onBOCreateSuccess(const wchar_t* strBOID) {
        ControlBO::GetInstance().startBO();
    }
};

class ControlBO 
{
public:

    bool createBO() {

        //is handler Rights?
        while (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj == nullptr ||
            MyMeetingBOControllerEvent::GetInstance().mypDataHelperObj == nullptr ||
            MyMeetingBOControllerEvent::GetInstance().mypAdminObj == nullptr) {
            TenderUtil::DebugPrintf("bo helpers is null. wait 1s");
            Sleep(1000);
        }

        ZOOMSDK::BOOption option;
        option.countdown_seconds = ZOOMSDK::BO_STOP_COUNTDOWN::BO_STOP_NOT_COUNTDOWN;
        option.IsParticipantCanChooseBO = true;
        option.IsAutoMoveAllAssignedParticipantsEnabled = true;
        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->SetBOOption(option);

        //set callback
        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->SetEvent(&MyBOCreatorEvent::GetInstance());

        //create
        const wchar_t* BO_ID = MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->CreateBO(L"Groupe1");

        ZOOMSDK::IList<const wchar_t*>* unassignedUserList = MyMeetingBOControllerEvent::GetInstance().mypDataHelperObj->GetUnassginedUserList();
        for (int i = 0; i < unassignedUserList->GetCount(); i++)
        {
            const wchar_t* strUserID = unassignedUserList->GetItem(i);
            const wchar_t* pwUsername = MyMeetingBOControllerEvent::GetInstance().mypDataHelperObj->GetBOUserName(strUserID);
            if (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->AssignUserToBO(strUserID, BO_ID)) {
                MyPrint("assign success");
            }
            else
            {
                MyPrint("assign error");
            }
        }
        return true;
    }

    void startBO() {

        //set callback
        MyMeetingBOControllerEvent::GetInstance().mypAdminObj->SetEvent(this);
        
        if (MyMeetingBOControllerEvent::GetInstance().mypAdminObj->StartBO()) {
            MyPrint("start success");
        }
        else
        {
            MyPrint("start success");
        }

        return;
    }
}

```

but , it code is cant assign user.

```auto

class ControlBO 
{
public:

    bool createBO() {

        //is handler Rights?
        while (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj == nullptr ||
            MyMeetingBOControllerEvent::GetInstance().mypDataHelperObj == nullptr ||
            MyMeetingBOControllerEvent::GetInstance().mypAdminObj == nullptr) {
            TenderUtil::DebugPrintf("bo helpers is null. wait 1s");
            Sleep(1000);
        }

        ZOOMSDK::BOOption option;
        option.countdown_seconds = ZOOMSDK::BO_STOP_COUNTDOWN::BO_STOP_NOT_COUNTDOWN;
        option.IsParticipantCanChooseBO = true;
        option.IsAutoMoveAllAssignedParticipantsEnabled = true;
        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->SetBOOption(option);

        //set callback
        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->SetEvent(&MyBOCreatorEvent::GetInstance());

        //get participants
        auto m_meeting_participants_ctr = SDKInterfaceWrap::GetInst().GetMeetingParticipantsController();
        auto participantsList = m_meeting_participants_ctr->GetParticipantsList();

        //create bo
        const wchar_t* BO_ID = MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->CreateBO(L"Groupe1");

        for (int i = 0; i < participantsList->GetCount(); i++)
        {
            auto participantId = participantsList->GetItem(i);

            char buffer[_MAX_U64TOSTR_BASE2_COUNT];
            _itoa(participantId, buffer, 10);
            wchar_t* userid = ctow(buffer);

            if (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->AssignUserToBO(userid, BO_ID)) {
                myprint("AssignUserToBO success");
            }
            else
            {
                myprint("AssignUserToBO error");
            }

        }
    
        return true;
    }

    void startBO() {

        //set callback
        MyMeetingBOControllerEvent::GetInstance().mypAdminObj->SetEvent(this);
        
        if (MyMeetingBOControllerEvent::GetInstance().mypAdminObj->StartBO()) {
            MyPrint("start success");
        }
        else
        {
            MyPrint("start success");
        }

        return;
    }
}

```

I used zoom’s webapi to get the user\_id of the participant.

I added an attribute for each user\_id and created data divided into two user groups.

I also want to divide BO according to the data.

I want to use the values ​​of web api and web hook.

participantid? registantid?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [March 29, 2022, 4:46pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/6 "2022-03-29T16:46:35Z")

</div>

Hi @hanataba,

The userID for breakout rooms is different from the IDs returned from the REST API. Can you please try using the [`IBOData`](https://marketplacefront.zoom.us/sdk/meeting/windows/class_i_b_o_data.html) interface instead to access which users you can assign?

Thanks!

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [April 1, 2022, 4:41am UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/7 "2022-04-01T04:41:46Z")

</div>

> [@jon.zoom](#):
>
> The userID for breakout rooms is different from the IDs returned from the REST API. Can you please try using the [`IBOData`](https://marketplacefront.zoom.us/sdk/meeting/windows/class_i_b_o_data.html) interface instead to access which users you can assign?

Is there any way to identify which participant is the strUserId obtained from IBOData?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 4, 2022, 6:42pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/8 "2022-04-04T18:42:12Z")

</div>

Hi @hanataba,

You can identify the user by passing that ID into [GetBOUserName](https://marketplacefront.zoom.us/sdk/meeting/windows/class_i_b_o_data.html#aa618ca1837dafc3f42c8596f2269afea). Currently this is the only information that is associated with a BO ID.

Thanks!

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [April 5, 2022, 9:46am UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/9 "2022-04-05T09:46:20Z")

</div>

I see…

I understand.

But I do not think it is a good way.

I thought that participant\_id should also be given.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 5, 2022, 8:31pm UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/10 "2022-04-05T20:31:13Z")

</div>

Hi @hanataba,

We completely understand that this is not an ideal scenario for some use cases and appreciate the feedback. We will take this into account as we continue working toward improving our SDKs. 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 6, 2022, 6:31am UTC](https://devforum.zoom.us/t/how-can-i-get-the-userid-to-use-to-assignusertobo/66276/11 "2022-05-06T06:31:20Z")

</div>

Closed on May 6, 2022, 6:31am UTC

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