Link directories
To integrate the Meeting SDK for Linux, import the Video SDK libraries, initialize the SDK, authenticate the SDK, authenticate the users, and finally enable logging.
Import the Video SDK libraries
As mentioned in the Verify Files section, the header folder ./h, the lib*so libraries, and the ./qt_libs dependency library are the needed header files and libraries to build an SDK Application.
Assume your project has a file structure similar to this one, and see how you can include and link the SDK into your project.
demo
├── include
│ └── h
└── lib
└── qt_libs
└── lib*so
# Link directories
link_directories(
${CMAKE_SOURCE_DIR}/lib
${CMAKE_SOURCE_DIR}/lib/qt_libs
${CMAKE_SOURCE_DIR}/lib/qt_libs/Qt/lib
)
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/include/h
)
# Create a symbolic link
execute_process(COMMAND ln -s libmeetingsdk.so libmeetingsdk.so.1
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/zoom_meeting_sdk
)
Initialize the SDK
To initialize the SDK, add setup information to the InitParam structure.
- Set the
strWebDomainand thestrSupportUrlto "https://zoom.us". - Set the
emLanguageID. In this example, we set the language ID to English. - Set the
enableGenerateDumpto eithertrueorfalse.Truemeans that the SDK log will be generated. UI. - Call the
InitSDKmethod to initialize the SDK.
ZOOM_SDK_NAMESPACE::InitParam initParam;
initParam.strWebDomain = "https://zoom.us";
initParam.strSupportUrl = "https://zoom.us";
//set language id
initParam.emLanguageID = ZOOM_SDK_NAMESPACE::LANGUAGE_English;
initParam.enableLogByDefault = true;
initParam.enableGenerateDump = true;
err = ZOOM_SDK_NAMESPACE::InitSDK(initParam);
Check the error returned from InitSDK method. If the error is anything other than SDKERR_SUCCESS, the SDK initialization did not succeed. Check the returned error code for more information.
Authenticate the SDK
To authenticate the SDK and start and join meetings, you will need to authenticate the meeting.
- A JWT token to authenticate the app
- For individual users, a Zoom Access Key (ZAK) - send a GET request to the https://api.zoom.us/v2/users/{userId}/token with
type="zak"and pass it to the SDK with JoinMeetingParam4WithoutLogin's userZAK or StartMeetingParamsWithoutLogin's userZAK. - For apps that need to join the meeting as individual users, an OnBehalf Of (OBF) token - send a GET request to https://api.zoom.us/v2/users/{userId}/token with
type="onbehalf"and pass it to the SDK with JoinMeetingParam4WithoutLogin's onBehalfToken.
To authenticate the SDK, populate the AuthContext structure.
- Set the
jwt_tokenwith the generated JWT. - Call
SDKAuthto authenticate the SDK.
ZOOM_SDK_NAMESPACE::AuthContext param;
param.jwt_token = "jwt Token";
ZOOM_SDK_NAMESPACE::IAuthService* _auth_service;
ZOOM_SDK_NAMESPACE::CreateAuthService(&_auth_service);
ZOOM_SDK_NAMESPACE::SDKError err = _auth_service->SDKAuth(param);
Authenticate the users
Before you start using the Meeting SDK for Linux, authenticate the user first.
-
To log in an end user, use a Zoom Access Key (ZAK) token - send a GET request to the https://api.zoom.us/v2/users/{userId}/token with
type="zak"and pass it to the SDK with JoinMeetingParam4WithoutLogin's userZAK. -
To log in apps that need to join the meeting as individual users, an On Behalf Of (OBF) token - send a GET request to https://api.zoom.us/v2/users/{userId}/token with
type="onbehalf"and pass it to the SDK with JoinMeetingParam4WithoutLogin's onBehalfToken. -
To log out an end user, use the
LogOut()method.
Enable logging
To enable logging, set the enableLogByDefault parameter in your InitParam object to true.
initParam.enableLogByDefault = true;
Once you've initialized the log feature, the log file appears under /home/{username}/.zoomsdk.