Problem with JWT authorization using Zoom provided examples

Hello.
I’m following tutorial " Create a Video SDK app".
I generated JWT using the example videosdk-auth-endpoint-sample .
I’m getting a signature like that:
curl -L -X POST ‘http://localhost:4000’ \

    -H 'Content-Type: application/json' \
    -d '{ "sessionName": "testSession1", "role": 1,"sessionKey": "session123", "userIdentity": "user1"}'

{“signature”:“xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx…xxxxxxxxxxxxxxxxxxx”}

And then trying to authorize.
curl \

–request GET
–header “Authorization: Bearer xxxxxxxxxxxxxxxxx”
–header “Accept: application/json”
–url “https://api.zoom.us/v2/videosdk/sessions

And always get a response:
{“code”:124,“message”:“Invalid access token.”}
Also, I used this signature directly for Linux SDK initialization, and it looks the same as it didn’t work. I.e. after SDK initialization it receives - 0 users, and ZoomVideoSDKDelegate is always silent.

Also, I see that in all tutorials SDK key and secret is used, but in market place I have also API key and secret. Could you please explain In which cases API key\secret is used?
Would appreciate for any help.

@abahno ,

For SDK Key and SDK Secret, this pair is used only for SDK Authentication.
For API Key and API Secret, this pair is used only for API Access, such as https://api.zoom.us/v2/videosdk/sessions

@chunsiong.zoom Thank you for the explanation.

I managed to run videosdk-web-sample from Zoom repo, but I can’t make Linux SDK work. The received session is always “empty” - no user, no session name …
My output is:

Video SDK version: 1.8.10 (6932)
initializing SDK error code: 0
in session: 0, sessionID: , sessionNumber: 0, sessionPass: , sessionName: , sessionHostName:
number of users 0

I’m using the code below. Here I copy past the token that was generated with web-sample(I use it since I know that it works for sure).

The other problem with log absence, I put enableLog = true but SDK produces no log files.
Here is my code:

IZoomVideoSDK* sdk = CreateZoomVideoSDKObj();
assert(sdk != nullptr);
std::cout << "Video SDK version: " << sdk->getSDKVersion() << std::endl;

ZoomVideoSDKInitParams iniParams;
iniParams.domain = "https://go.zoom.us"; //"https://zoom.us";
iniParams.enableLog = true;
iniParams.logFilePrefix = "logPrefix";
iniParams.enableIndirectRawdata = false;
iniParams.audioRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeStack;
iniParams.videoRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeStack;

ZoomVideoSDKErrors iniError = sdk->initialize(iniParams);
std::cout << "initializing SDK error code: " << iniError << std::endl;
assert(iniError == ZoomVideoSDKErrors_Success);   

CSDKListener listener(sdk);
sdk->addListener(&listener);

ZoomVideoSDKSessionContext sessionContext;

sessionContext.token = {{generated token with the same topic and user name from web-sample}};
sessionContext.userName = "name1";
sessionContext.sessionName = "topic"; 

IZoomVideoSDKSession* session = sdk->joinSession(sessionContext);
assert(session != nullptr);

std::string sessionId = session->getSessionID() != NULL ? session->getSessionID()  : "";
int sessionNumber = session->getSessionNumber();
std::string sessionName = session->getSessionName() != NULL ? session->getSessionName() : "";
std::string sessionHostName = session->getSessionPassword() != NULL ? session->getSessionPassword() : "";
std::string sessionPassword = session->getSessionName() != NULL ? session->getSessionName() : "";

std::cout << "in session: " << sdk->isInSession()
		  << ", sessionID: " << sessionId 
		  << ", sessionNumber: " << sessionNumber
		  << ", sessionPass: " << sessionPassword
		  << ", sessionName: " << sessionName
		  << ", sessionHostName: " << sessionHostName
		  << std::endl;

IVideoSDKVector<IZoomVideoSDKUser*>* users = session->getRemoteUsers();
assert(users != nullptr);
std::cout << "number of users " << users->GetCount() << std::endl;
return 0;

Would appreciate for any help.

@abahno , is the sessionName “topic”?

yes, the sessionName is topic.

Unfortunately, I still have this issue with Linux SDK.
@chunsiong.zoom If any additional information is required, please ping me.

Thanks in advance.

@abahno , so the issue you have is that Linux Video SDK cannot connect to your Video SDK for Web session?

-H ‘Content-Type: application/json’
-d ‘{ “sessionName”: “testSession1”, “role”: 1,“sessionKey”: “session123”, “userIdentity”: “user1”}’

I see that you have sessionKey entered in your Web SDK. Could you try remove that and making sure it is empty, so that both SDK have similar parameters when joining/starting a VideoSession?

@chunsiong.zoom I apologize for the late response, I switched to Windows SDK for some time.
I guess the problem is that I’m trying to run a console application, and as mentioned here joinSession Event callbacks are not fired for Windows it’s required to run a message loop. I guess Linux SDK needs something similar. Could you please provide more details on how the event loop for SDK functions? I see that Linux SDK goes with a bunch of QT libs, I have to use qt_event_loop or something else from QT?
PS: I’m testing the same code for Zoom SDK on Windows and Linux. On Windows all works fine.

Update: I see similar problem in another post - Unable to join session with Zoom Video SDK for Linux
Looks like problem with Linux SDK.

@abahno I’m working on publishing the sample for Linux Video SDK

My main method does something like this

GMainLoop* loop;
.
.
.
.
.


gboolean timeout_callback(gpointer data)
{
	return TRUE;
}

void my_handler(int s)
{
	printf("\nCaught signal %d\n", s);
	video_sdk_obj->leaveSession(false);
	printf("Leaving session.\n");
}

int main(int argc, char* argv[])
{
.
.
.
.
.
.

	printf("begin to join: %s\n", self_dir.c_str());
	joinVideoSDKSession(session_name, session_psw, session_token);

	struct sigaction sigIntHandler;

	sigIntHandler.sa_handler = my_handler;
	sigemptyset(&sigIntHandler.sa_mask);
	sigIntHandler.sa_flags = 0;

	sigaction(SIGINT, &sigIntHandler, NULL);

	loop = g_main_loop_new(NULL, FALSE);

	// add source to default context
	g_timeout_add(100, timeout_callback, loop);
	g_main_loop_run(loop);
	return 0;
}

@chunsiong Linux Sample will be really helpful. Thank you!