How can I get the userid to use to AssignUserToBO?

Description

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

//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

    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

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. For example, onHasCreatorRightsNotification indicates that you can now create a breakout room through IBOCreator.

Thanks!

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.

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
 

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!

changeed to start BO Start after receiving onHasCreatorRightsNotification and onBOCreateSuccess.

this code is success. can open BO.

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.


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?

Hi @hanataba,

The userID for breakout rooms is different from the IDs returned from the REST API. Can you please try using the IBOData interface instead to access which users you can assign?

Thanks!

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

Hi @hanataba,

You can identify the user by passing that ID into GetBOUserName. Currently this is the only information that is associated with a BO ID.

Thanks!

I see…

I understand.

But I do not think it is a good way.

I thought that participant_id should also be given.

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. :slightly_smiling_face:

Thanks!

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