# Windows SDK functions For API documentation, please visit the [Meeting API reference](/docs/api/meetings). ## Initialization You can find these APIs in `zoom_sdk.h.` Please call Zoom SDK APIs in main UI thread for thread-safe operation. ### Initialize Zoom SDK and create authentication service When initializing the SDK, also include the `auth_service_interface.h` code string. > Please do not use raw IP address as the web domain > > Please do not use raw IP address as the web domain. It will open your app > to vulnerability issues. To learn why, see our [security practices](/docs/meeting-sdk/security-practices/). **Code sample** ```cpp void AuthorizeSDK() { // Initialize SDK with InitParam object ZOOM_SDK_NAMESPACE::InitParam initParam; ZOOM_SDK_NAMESPACE::SDKError initReturnVal(ZOOM_SDK_NAMESPACE::SDKERR_UNINITIALIZE); // Set web domain to zoom.us initParam.strWebDomain = L"https://zoom.us"; initReturnVal = ZOOM_SDK_NAMESPACE::InitSDK(initParam); // Check if InitSDK call succeeded if (initReturnVal == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Create IAuthService object to perform Auth actions ZOOM_SDK_NAMESPACE::IAuthService* authService; ZOOM_SDK_NAMESPACE::SDKError authServiceInitReturnVal = ZOOM_SDK_NAMESPACE::CreateAuthService(&authService); if (authServiceInitReturnVal == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Create IAuthServiceEvent object to listen for Auth events from SDK ZOOM_SDK_NAMESPACE::IAuthServiceEvent* authListener; // Auth SDK with AuthContext object ZOOM_SDK_NAMESPACE::AuthContext authContext; ZOOM_SDK_NAMESPACE::SDKError authCallReturnValue(ZOOM_SDK_NAMESPACE::SDKERR_UNAUTHENTICATION); // Call SetEvent to assign your IAuthServiceEvent listener yourAuthServiceEventListener = new YourAuthServiceEventListener(); authListener = yourAuthServiceEventListener; authService->SetEvent(authListener); // Provide your JWT to the AuthContext object authContext.jwt_token = L"Your JWT token here"; authCallReturnValue = authService->SDKAuth(authContext); if (authCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // SDK Auth in progress } } } } void yourAuthServiceEventListener::onAuthenticationReturn(ZOOM_SDK_NAMESPACE::AuthResult ret) { if (ret == ZOOM_SDK_NAMESPACE::SDKError::AUTHRET_JWTTOKENWRONG) { // SDK Auth call failed because the JWT token is invalid. } else if (ret == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // SDK Authenticated successfully } } ``` ## Use the authentication service When you first start using the Meeting SDK, you should do the authentication first. ### Log in end-user See [Support OAuth in SDK app](/docs/meeting-sdk/auth/) for details. ### Log out end-user **Code sample** ```cpp void logoutUser() { // Call Logout on your IAuthService instance ZOOM_SDK_NAMESPACE::SDKError logoutCallReturnValue(ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN); logoutCallReturnValue = yourSDKInstance->authService->Logout(); if (logoutCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Logout call succeeded, listen for logout result using the onLogoutRet callback } } ``` ## Meeting service To use the meeting service, include the `meeting_service_interface.h.` code string. ### Create the meeting service **Code sample** ```cpp void createMeetingService() { // Create IMeetingService object to perform meeting actions ZOOM_SDK_NAMESPACE::IMeetingService* meetingService; ZOOM_SDK_NAMESPACE::SDKError meetingServiceInitReturnVal = ZOOM_SDK_NAMESPACE::CreateMeetingService(&meetingService); if (meetingServiceInitReturnVal == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // MeetingService was created successfully, it is recommended to store this value for use across the application } } ``` ### Start a meeting for a non-logged in user Use this code if the user is not logged in to Zoom through the SDK yet. This method requires [obtaining a Zoom Access Key (ZAK) token](/docs/api/users/#tag/users/GET/users/me/zak) for the user from the REST API, so the user is referred to as an "API user" in the code. **Code sample** ```cpp void startMeetingForApiUser() { // Start meeting for API user with StartParam object ZOOM_SDK_NAMESPACE::StartParam startMeetingParam; // Provide meeting credentials for API user using StartParam4WithoutLogin ZOOM_SDK_NAMESPACE::StartParam4WithoutLogin startMeetingWithoutLoginParam; startMeetingParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_WITHOUT_LOGIN; startMeetingWithoutLoginParam.zoomuserType = ZOOM_SDK_NAMESPACE::ZoomUserType_APIUSER; startMeetingWithoutLoginParam.meetingNumber = 1234567890; // Starting a meeting without the user logging in requires a ZAK token startMeetingWithoutLoginParam.userZAK = L"ZAK token for user"; startMeetingWithoutLoginParam.userID = L"User ID or email for user"; startMeetingWithoutLoginParam.userName = L"Display name for user"; startMeetingParam.param.withoutloginStart = startMeetingWithoutLoginParam; ZOOM_SDK_NAMESPACE::SDKError startMeetingCallReturnValue(ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN); startMeetingCallReturnValue = yourMeetingServiceInstance->Start(startMeetingParam); if (startMeetingCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Start meeting call succeeded, listen for start meeting result using the onMeetingStatusChanged callback } } ``` ### Start a meeting for a logged-in user Use this code can be used if the end-user has already logged in to Zoom through the SDK. **Code sample** ```cpp void startMeetingForEndUser() { // Start meeting for end user with StartParam object ZOOM_SDK_NAMESPACE::StartParam startMeetingParam; // Provide meeting credentials for end user using StartParam4NormalUser ZOOM_SDK_NAMESPACE::StartParam4NormalUser startMeetingForNormalUserParam; startMeetingParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_NORMALUSER; startMeetingForNormalUserParam.meetingNumber = 1234567890; startMeetingParam.param.normaluserStart = startMeetingForNormalUserParam; ZOOM_SDK_NAMESPACE::SDKError startMeetingCallReturnValue(ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN); startMeetingCallReturnValue = yourMeetingServiceInstance->Start(startMeetingParam); if (startMeetingCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Start meeting call succeeded, listen for start meeting result using the onMeetingStatusChanged callback } } ``` ### Join a meeting for an API user **Code sample** ```cpp void joinMeetingForAPIUser() { // Join meeting for API user with JoinParam object ZOOM_SDK_NAMESPACE::JoinParam joinMeetingParam; // Provide meeting credentials for API user using JoinParam4WithoutLogin ZOOM_SDK_NAMESPACE::JoinParam4WithoutLogin joinMeetingWithoutLoginParam; joinMeetingParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_WITHOUT_LOGIN; // If there is a ZAK token for this user provide it here, otherwise use JoinParam4NormalUser instead joinMeetingWithoutLoginParam.userZAK = L"ZAK token for user"; joinMeetingWithoutLoginParam.meetingNumber = 1234567890; joinMeetingWithoutLoginParam.psw = L"Meeting password"; joinMeetingWithoutLoginParam.userName = L"Display name for user"; joinMeetingParam.param.withoutloginuserJoin = joinMeetingWithoutLoginParam; ZOOM_SDK_NAMESPACE::SDKError joinMeetingCallReturnValue(ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN); joinMeetingCallReturnValue = yourMeetingServiceInstance->Join(joinMeetingParam); if (joinMeetingCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Join meeting call succeeded, listen for join meeting result using the onMeetingStatusChanged callback } } ``` ### Join a meeting for and end user **Code sample** ```cpp void joinMeetingForEndUser() { // Join meeting for end user with JoinParam object ZOOM_SDK_NAMESPACE::JoinParam joinMeetingParam; // Provide meeting credentials for end user using JoinParam4NormalUser ZOOM_SDK_NAMESPACE::JoinParam4NormalUser joinMeetingForNormalUserLoginParam; joinMeetingParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_NORMALUSER; joinMeetingForNormalUserLoginParam.meetingNumber = 1234567890; joinMeetingForNormalUserLoginParam.psw = L"Meeting password"; joinMeetingForNormalUserLoginParam.userName = L"Display name for user"; joinMeetingParam.param.normaluserJoin = joinMeetingForNormalUserLoginParam; ZOOM_SDK_NAMESPACE::SDKError joinMeetingCallReturnValue(ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN); joinMeetingCallReturnValue = yourMeetingServiceInstance->Join(joinMeetingParam); if (joinMeetingCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // Join meeting call succeeded, listen for join meeting result using the onMeetingStatusChanged callback } } ``` ## Meeting UI controller Get this controller after you have been in the meeting. If you haven't been in the meeting previously, you can't use this controller. **Code sample** ```cpp void getMeetingUIController() { ZOOM_SDK_NAMESPACE::IMeetingUIController* meetingUIController = yourMeetingServiceInstance->GetUIController(); if (meetingUIController) { // Use the IMeetingUIController instance to control the Zoom Meeting UI, for example: meetingUIController->EnterFullScreen(enableFullScreenForPrimaryMonitor, enableFullScreenForSecondaryMonitor); meetingUIController->ShowChatDlg(showChatDlgParam); meetingUIController->SwtichToAcitveSpeaker(); } } ``` ### Meeting configuration controller You can set the meeting configuration controller before you call the start or join meeting API. If the meeting has ended the configuration will reset automatically. **Code sample** ```cpp void getMeetingConfigurationController() { ZOOM_SDK_NAMESPACE::IMeetingConfiguration* meetingConfiguration = yourMeetingServiceInstance->GetMeetingConfiguration(); if (meetingConfiguration) { // Use the IMeetingConfiguration instance to control the Zoom Meeting Configuration, for example: meetingConfiguration->EnableForceAutoStartMyVideoWhenJoinMeeting(true); meetingConfiguration->DisableAttendeeMenuItem(attendeeMenuItem); meetingConfiguration->HideShareButtonOnMeetingUI(true); } } ``` ### Meeting annotation controller You can get this controller when you or someone else are sharing screens. If not, this controller will not be accessible to you. **Code sample** ```cpp void getMeetingAnnotationController() { ZOOM_SDK_NAMESPACE::IAnnotationController* meetingAnnotationController = yourMeetingServiceInstance->GetAnnotationController(); if (meetingAnnotationController) { // Use the IAnnotationController instance to control the Zoom Meeting Annotations, for example: meetingAnnotationController->CanDoAnnotation(); meetingAnnotationController->StartAnnotation(ZOOM_SDK_NAMESPACE::SDK_FIRST_VIEW); meetingAnnotationController->SetColor(ZOOM_SDK_NAMESPACE::SDK_FIRST_VIEW, RGB(255, 255, 255)); meetingAnnotationController->StopAnnotation(ZOOM_SDK_NAMESPACE::SDK_FIRST_VIEW); } } ``` ## Setting service If you want to use this service, include the `setting_service_interface.h.` code string. **Code sample** ```cpp void createSettingService() { // Create ISettingService object to perform setting actions ZOOM_SDK_NAMESPACE::ISettingService* settingService; ZOOM_SDK_NAMESPACE::SDKError settingServiceInitReturnVal = ZOOM_SDK_NAMESPACE::CreateSettingService(&settingService); if (settingServiceInitReturnVal == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS) { // SettingService was created successfully, it is recommended to store this value for use across the application // Use the ISettingService instance to control the meeting settings, for example: settingService->GetRecordingSettings(); settingService->ShowSettingDlg(showSettingDialogueParam); settingService->GetVideoSettings(); } } ``` ## Get the current meeting's available audio types To get an integer representing the current meeting's supported audio type, call the `getSupportedMeetingAudioType` interface after joining a meeting. The integer value is `bitwise OR` - a bitwise operation - of each supported audio type presented in the `InMeetingSupportAudioType` enum. For example, if the current meeting supports both VOIP and telephony, the return value of `getSupportedMeetingAudioType` for that meeting is `AUDIO_TYPE_VOIP` and `AUDIO_TYPE_TELEPHONY`. **Interface** ```csharp virtual int GetSupportedMeetingAudioType() = 0; ``` **Enum** ```csharp enum InMeetingSupportAudioType { AUDIO_TYPE_NONE = 0, AUDIO_TYPE_VOIP = 1, AUDIO_TYPE_TELEPHONY = 1 << 1 }; ``` ---