Access in-meeting user information

The code on this page works with either the default UI or the custom UI.

After joining a meeting, access information for each meeting participant through IMeetingParticipantsController and IMeetingParticipantsCtrlEvent.

Use one of several different IDs, each serving its own purpose, to access user information.

  • Customer key - A developer-supplied identifier that may be passed in through the JoinParam, specifically JoinParam4NormalUser::customer_key or JoinParam4WithoutLogin::customer_key to join a meeting.
  • User ID - A nonpersistent, unique per-user identifier assigned by Zoom for the current meeting. If a user leaves and rejoins the same meeting, they get a new user ID assigned each time they join. This is also reassigned when switching between the main meeting and breakout rooms.
  • Persistent ID - A per-user identifier assigned by Zoom for the current meeting and all submeetings, such as breakout rooms. This per-user identifier will not be reassigned in the same meeting or submeeting, but users in different meetings may have the same ID value.
  • Participant ID - A unique per-user identifier assigned by Zoom to a user's account. This persists across all meetings for an account. You can't access this ID through the macOS SDK, but can retrieve it through the REST API.

When a user joins a meeting, get their IUserInfo object.

void ZMSDKWindow::InitParticipantEvents(ZOOM_SDK_NAMESPACE::IMeetingService* meetingService)
{
    if (!meetingService)
        return;
    m_participantsCtrl = meetingService->GetMeetingParticipantsController();
    if (!m_participantsCtrl)
        return;
    m_participantsCtrl->SetEvent(this);
}
void ZMSDKWindow::onUserJoin(ZOOM_SDK_NAMESPACE::IList<unsigned int>* lstUserID,
                             const zchar_t* /*strUserList*/)
{
    if (!lstUserID || !m_participantsCtrl)
        return;
    for (int i = 0; i < lstUserID->GetCount(); ++i)
    {
        unsigned int userID = lstUserID->GetItem(i);
        ZOOM_SDK_NAMESPACE::IUserInfo* userInfo =
            m_participantsCtrl->GetUserByUserID(userID);
        if (userInfo)
        {
            const zchar_t* userName = userInfo->GetUserName();
            unsigned int joinedUserID = userInfo->GetUserID();
        }
    }
}

Use the IUserInfor to access data specific to that user.

Get the customer key.

userInfo->GetCustomerKey();

Get the user's avatar picture path, if available.

userInfo->GetAvatarPath();

Get the user ID.

userInfo->GetUserID();

Get the username.

userInfo->GetUserName();

Get the persistent ID.

userInfo->GetPersistentId();

Each user in a meeting or webinar has a role assigned to one of these values under UserRole.

  • USERROLE_NONE - No role has been assigned.
  • USERROLE_HOST - The host of the current meeting or webinar.
  • USERROLE_COHOST - A co-host of the current meeting or webinar.
  • USERROLE_PANELIST - A panelist in the current meeting or webinar.
  • USERROLE_BREAKOUTROOM_MODERATOR - The breakout room moderator.
  • USERROLE_ATTENDEE - An attendee of the current meeting or webinar.

Get the user’s role in the current meeting.

userInfo->GetUserRole();

Determine whether a given user is the current user.

userInfo->IsMySelf();