Participation in ZoomMeeting with Windows, C++SDK

Hello.
I would like to join a Zoom Meeting that I have created using the C++ Zoom SDK on Windows and play camera video and audio on the application screen.
I have registered Server-To-Server-Oauth as an application and by making that request, it is now possible to create a Meeting.
Now I would like to participate in this meeting from a C++ Windows application.
I am trying to join the meeting from “IMeetingService” with Join() or Start() function, but it does not work.

I don’t know where I can get join_token and customer_key for meetingService->Join.
In meetingService->Start, I pasted the “zak=” part from the URL when I created the meeting with the API, but I get a ZOOM_SDK_NAMESPACE::SDKERR_UNAUTHENTICATION error.


    // join
    ZOOM_SDK_NAMESPACE::IMeetingService *meetingService;
    ZOOM_SDK_NAMESPACE::SDKError meetingServiceInitReturnVal = ZOOM_SDK_NAMESPACE::CreateMeetingService( &meetingService );
    if ( meetingServiceInitReturnVal == ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS )
    {
        ZOOM_SDK_NAMESPACE::JoinParam joinParam;
        joinParam.userType = ZOOM_SDK_NAMESPACE::SDKUserType::SDK_UT_NORMALUSER;
        joinParam.param.normaluserJoin.meetingNumber = 98765432109;
        joinParam.param.normaluserJoin.psw = L"xxxxxx";
        joinParam.param.normaluserJoin.userName = L"XX";
        joinParam.param.normaluserJoin.join_token = L"???";
        joinParam.param.normaluserJoin.customer_key = L"???";

        ZOOM_SDK_NAMESPACE::SDKError joinReturnVal = meetingService->Join( joinParam );
        if ( joinReturnVal == ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS )
        {
            qDebug() << "Success.";
        }
    }
    // start
    ZOOM_SDK_NAMESPACE::StartParam startMeetingParam;
    ZOOM_SDK_NAMESPACE::StartParam4WithoutLogin startMeetingWithoutLoginParam;

    startMeetingParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_WITHOUT_LOGIN;

    startMeetingWithoutLoginParam.meetingNumber = 98765432109;
    startMeetingWithoutLoginParam.userName = L"XX"; 
    startMeetingWithoutLoginParam.userZAK = L"...";
    startMeetingWithoutLoginParam.zoomuserType = ZOOM_SDK_NAMESPACE::ZoomUserType_APIUSER;
    startMeetingParam.param.withoutloginStart = startMeetingWithoutLoginParam;

    ZOOM_SDK_NAMESPACE::SDKError startMeetingCallReturnValue( ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN );
    startMeetingCallReturnValue = meetingService->Start( startMeetingParam );
    if (startMeetingCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS)
    {
        qDebug() << "Success.";
    }

@n-chubachi ,

Please try to leave join_token and customer_key alone for now.

To join a meeting, you should just need to authenticate the SDK, pass in the meeting number and password.

To start a meeting, you will need to authenticate the SDK, pass in the meeting number and userZAK token.

1 Like

Thank you very much. Appreciate it.
To get zak_token using the API “/users/me/token?type=zak”.
To get join_token using “/meetings/{MeetingNumber}/jointoken/local_recording”.
I don’t know the equivalent location for customer_key.
Currently, join_token and customer_key are commented out.

IAuthService SDKAuth() succeeded by creating the appropriate jwt.
After the SDKAuth(), the IAuthServiceEvent callback “onAuthenticationReturn()” confirms that the SDK authentication has passed.
After this, I tried to start and join the Meeting, but I still get the SDKERR_UNAUTHENTICATION error.

The meeting number and password are set by checking for meetings that exist.

Is there any other possible cause?
Or is there a mistake in the procedure?

@n-chubachi ,

The OnAuthenticationReturn can return either sucess or failure. You might need to check this value.
If the return value is failure, I would recommend looking the JWT token which was used to authenticate the SDK.

If the OnAuthenticationReturn is success, you should be able to join / start meeting with no issues.

The token which you are using are correct.

You might not need to enter this. This specific token is supposed to be entered in app_privilege_token

1 Like

Thanks for the advice.
I checked the return value of OnAuthenticationReturn and it was AUTHRET_JWTTOKENWRONG. it seems that the JWT token was invalid and the authentication did not pass.

[Meeting SDK Auth]

When the JWT token was re-created and executed as shown here, it became AUTHRET_SUCCESS and the authentication succeeded.
After the authentication succeeded, I tried to join a Meeting and it succeeded and I am now waiting to join a Meeting! Thank you very much.
However, when I tried Meeting Start, it failed with SDKERR_INVALID_PARAMETER.

    ZOOM_SDK_NAMESPACE::StartParam startMeetingParam;
    ZOOM_SDK_NAMESPACE::StartParam4WithoutLogin startMeetingWithoutLoginParam;

    startMeetingParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_WITHOUT_LOGIN;
    startMeetingWithoutLoginParam.zoomuserType         = ZOOM_SDK_NAMESPACE::ZoomUserType_APIUSER;
    startMeetingWithoutLoginParam.meetingNumber        = meetingNumber;
    startMeetingWithoutLoginParam.userName             = userName;
    startMeetingWithoutLoginParam.userZAK              = zak_key.c_str();
    startMeetingParam.param.withoutloginStart = startMeetingWithoutLoginParam;

    ZOOM_SDK_NAMESPACE::SDKError startMeetingCallReturnValue( ZOOM_SDK_NAMESPACE::SDKERR_UNKNOWN );
    startMeetingCallReturnValue = meetingService->Start( startMeetingParam );
    if (startMeetingCallReturnValue == ZOOM_SDK_NAMESPACE::SDKError::SDKERR_SUCCESS)
    {
        qDebug() << "Success.";
    }

I think the zak token I got from the API is correct. Could this be due to the fact that once the value is held in a string type?

@n-chubachi ,

I’ll suggest getting the ZAK token again.
This time round, could you try this endpoint instead?
/users/:userId/token?type=zak&ttl=7200

1 Like

I tried it and the result of Meeting Start is the same: SDKERR_INVALID_PARAMETER.
I did not create any user, so I put “me” in “:userId”.
To start a meeting, create a user, get a zak token from the userId, and use that zak token. Do I need to use that zak token?

I tried the user creation API “https://api.zoom.us/v2/users/create” as a test, but it returned a RequestError405 indicating that I am not authorized to do so.

Thank you.

@n-chubachi ,

To start a meeting here’s the typical process.

  1. Create a user (if you don’t already have an existing user)
  2. Schedule a meeting (You can either use use Create Meeting API, Zoom Client or Zoom portal)
  3. Get the user’s ZAK token
  4. Use the meetingNumber from 2, username and ZAK to start a meeting

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