Facing Issue in Video SDK Web Integration

Video SDK Type - Web
SDK version - 1.10.7
Issue - 1 : I need to set session time .
I am using this config.
{
sdkKey: 'XXXXXXXXX,
sdkSecret: ‘XXXXXXXXXXXX’,
webEndpoint: ‘zoom.us’,
topic: ‘XXX’,
name: XXXX,
password: ‘XXXXX’,
signature: ‘’,
sessionKey: ‘’,
userIdentity: ‘’,
role: 1
}
For join : join(topic, signature, name, password)
Where need to set the session time. Is there a way to set session time in Client side .Kindly guide me .

Issue -2 : Is there any way to force end the whole session from client side . In case the Host leaves the session without ending and doesn’t return.

Issue - 3 : By changing the role value to 0 and tries to join the room. When host removes the participant . The same particicpant can able to re-join after ZoomClient.destroyClient() and re - initiate the join method ZoomClient.join(). Can you explain why this happens ?
The zoomId and userId gets different even though i use the same -
topic: ‘XXX’,
name: XXXX,
password: ‘XXXXX’,
signature: ‘’,

@siddharth23 ,

  1. There is no concept of scheduling or session time for Video SDK. The call is started on demand.

  2. If you are asking if there is a way to end a session in case the host doesnt end, yes there is. You can end a session using the Video SDK REST API
    Zoom Video SDK API

  3. You might need to elaborate this a little bit. I’ll try to explain this from what I understand from your question.

Even if the topic name is the same, the 1st session which has ended is not the same session as the 2nd session which the participant joins. They have different sessionId on your zoom.us dashboard.

Thanks for the reply , Is there any sample git hub where Video SDK REST API has been intergrated with Video SDK Web it would be helpful .

I have Query - While Developer account creation should i need to pay or add any extra feature for Video SDK REST API

Reg - Issue 3 : Participant able to rejoin
In my code :
signature creation : { alg: ‘HS256’, typ: ‘JWT’ };
I am using this host config
{
sdkKey: 'XXXXXXXXX,
sdkSecret: ‘XXXXXXXXXXXX’,
webEndpoint: ‘zoom.us’,
topic: ‘XXX’,
name: XXXX ,
password: ‘XXXXX’,
signature: ‘’,
sessionKey: ‘’,
userIdentity: ‘’,
role: 1
}
And for partciapnt : same config with role as 0
{
sdkKey: 'XXXXXXXXX,
sdkSecret: ‘XXXXXXXXXXXX’,
webEndpoint: ‘zoom.us’,
topic: ‘XXX’,
name: XXXX ,
password: ‘XXXXX’,
signature: ‘’,
sessionKey: ‘’,
userIdentity: ‘’,
role: 1
}
Note : ZoomClient gets destroy and re-initiated on refresh

Here i am only passing the username and session name but after zoom.join() in response i am able to get sessionId , userId and zoomId . when host removes the participant from room , he able to join the room with same configuration after refreshing withsessionId , userId and zoomId gets vary .

How can i predefined set the sessionId and userId from the client side config to avoid the praticipant rejoin or is there any other way to stop the participant from rejoin . Kindly guide me.

Is there any sample git hub where Video SDK REST API has been intergrated with Video SDK Web it would be helpful .

No there isn’t but there is a postman workspace for you to easily call the API for dev and test
https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/documentation/22097587-88699248-914a-4197-be40-0776c687db20

I have Query - While Developer account creation should i need to pay or add any extra feature for Video SDK REST API

There is no additional fees associated with REST API.

How can i predefined set the sessionId and userId from the client side config to avoid the praticipant rejoin or is there any other way to stop the participant from rejoin . Kindly guide me.

You can provide the Video SDK Auth / Signature only once to the user, and ensure that it expires within a short timeframe.

Hi @chunsiong.zoom Thanks for the reply .
I tried using the web rest API . I am getting the response
ex:
API : https://api.zoom.us/v2/videosdk/sessions/${doubleEncodeded}?type=live
with jwt token in header
Response : {“code”:2300,“message”:“This API endpoint is not recognized.”}
First I Got CORS ISSUE and i resolved it by creating a proxy serve in my client side now i am facing this issue .
Here is my response header tracking ID :
v=2.0;clid=aw1;rid=WEB_4b7a7dc0d472cd87f19fbaf1ad9ce97a
Kindly guide in this .

@siddharth23 ,

There is no /v2/api/videosdk/sessions/
It should be /v2/videosdk/session/

Could you double check on the code level for the URL?

The proxy server re-write path was not working , i removed it . Still i am facing
{“code”:124,“message”:“Invalid access token.”}
Tracking ID : v=2.0;clid=aw1;rid=WEB_e428346abfc83575686463923ea09b4b
I create the JWT Token using these concept as mention in the docs

const KJUR = require(‘jsrsasign’)
// jsrsasign - npm
function generateVideoSdkApiJwt(sdkApiKey, sdkApiSecret) {

** const iat = Math.round((new Date().getTime() - 30000) / 1000)**
** const exp = iat + 60 * 60 * 2**
** const oHeader = { alg: ‘HS256’, typ: ‘JWT’ }**

** const oPayload = {**
** iss: sdkApiKey,**
** iat: iat,**
** exp: exp**
** }**

** const sHeader = JSON.stringify(oHeader)**
** const sPayload = JSON.stringify(oPayload)**
** const videosdk_api_token = KJUR.jws.JWS.sign(‘HS256’, sHeader, sPayload, sdkApiSecret)**
** return videosdk_api_token**
}

console.log(generateVideoSdkApiJwt(process.env.VIDEO_SDK_API_KEY, process.env.VIDEO_SDK_API_SECRET))

Kindly guide me where i am doing . How to solve the Invalid access token issue

@siddharth23 ,

for troubleshooting, could you trying using the JWT token found on marketplace.zoom.us?

@chunsiong.zoom Thanks for the troubleshoot solution
Using the Zoom account JWT token token error is resolved.
Query 1 : As mentioned above the signature creation of JWT is working fine to create a session , but using it in header for TOKEN AUTHENTICATION for RESTAPI is not working . May i know why?

Scenario : I am Host
In config i am using session name as “XXXXXXXXX”.
While joining zmClient.join(topic, signature, name, password) in response i am getting the sessionId . I am doubleencoding the sessionId and using RESTAPI to check the status
API : v2/videosdk/sessions/AP%252BkHiVdT7aHO3F1cxkjGw%253D%253D?type=live
Response : {“code”:3001,“message”:“Session does not exist.”}
Double Encoded :
const encoded=encodeURIComponent(sessionId);
const doubleEncodeded = encodeURIComponent(encoded);

But the host is in the session . May i know why i am facing this?.

@siddharth23

The API Key and API Secret is used to generate the JWT token for API Access

You cannot use SDK Key and SDK Secret to generate a JWT token for API Access
SDK Key and SDK Secret is only used for SDK Auth.

You might not need to doubleencode the sessionID

Here’s a sample of my sessionID

and here’s how it looks like from a REST API call on POSTMAN

Hi @chunsiong.zoom Thanks for the reply . After a creating a JWT using API key and secret . I am able to solve the autentication error .

Scenario : When the host close the tab and comes after a long time . I have a spec that i need to show re-join if the session is still active .

Issue : I have a session name and topic name ,
config.file
sdkKey: ‘XXXX,
sdkSecret: XXXX,
webEndpoint: ‘zoom.us’,
topic: ‘XXXX’,
name: XXX,
password: ‘XXX’,
signature: ‘’,
sessionKey:’',
userIdentity: ‘’,
role : 1,

I am able to get the sessionId in zoom.join(). The sessionId gets vary on each time refresh and try to join.
I need to know

  1. Does the zoom.join() make a new session each time .
  2. Is there a way to send sessionId from Client Side.

How to prevent the multiple sessionId . How i can achieve the re-join flow.Kindly guide in this.

If there is no one in the session for a while, the session will end. In this scenario, the session ID will change.

I am able to get the sessionId in zoom.join(). The sessionId gets vary on each time refresh and try to join.

This will happen if the host ends the session, or when everyone leaves the session.

  1. Does the zoom.join() make a new session each time .
  2. Is there a way to send sessionId from Client Side.
  1. Only if the session has ended, or everyone has left the session.
  2. You are able to get the sessionId from zoom.join right? That is the Client side I presume?

How to prevent the multiple sessionId . How i can achieve the re-join flow.Kindly guide in this.

Multiple sessionId is part of the design. As long as the session ends, a new sessionId is assigned to the next session with the same topic name.

Hi @chunsiong.zoom Thanks for your response .
I am using proxy server in my client side . I am able to hit GET api sucessfully.
But i am facing Invalid CORS request for PUT api.
This my response tracking ID :
v=2.0;clid=aw1;rid=WEB_b25fdad03523d7143b7f90c3fc73c078
Kindly help me in this.

@siddharth23 ,

can you make sure you are calling the right URL endpoint?
PUT is supported on

PUT /videosdk/sessions/{sessionId}/status

It is NOT support on
/videosdk/sessions/{sessionId}

@chunsiong.zoom I am hitting this endpoint
videosdk/sessions/ezaQ71HWRHmHfAcYNJMI2A%253D%253D/status
Facing Invalid CORS request for PUT api
Tracking ID : v=2.0;clid=aw1;rid=WEB_860f65d7476f8bae8352fb0c653ac55d
Kindly have a look at this Tracking ID.

@siddharth23 , are you doing something different when calling this API?
It seems that this request was being flagged by the firewall.

Could you tell me more about the implementation and the CORS?

@chunsiong.zoom
I am using VIDEO SDK in my react application. I am using localhost environment for testing
Scenario : Need to Update the status of the session as end.
API : PUT /videosdk/sessions/{sessionId}/status
SPEC : I need to handle this API’s calls from Client-side without back-end support.
Issues Facing:
I tried calling a GET API from CLIENT side - I got CORS ISSUE.
To Solve CORS ISSUE : I used a proxy middleware in client side using a third party package.
CODE EXAMPLE:
const { createProxyMiddleware } = require(‘http-proxy-middleware’);
module.exports = function (app) {
app.use(
‘/v2/’,
createProxyMiddleware({
target: ‘https://api.zoom.us/’,
changeOrigin: true,
})
);
};
API CALL :
Axios.put(/v2/videosdk/sessions/${doubleEncodeded}/status,{
action : “end”
},{
headers : {
authorization: Bearer ${JWTtoken},
},
}
Get API’s are working Fine but i am getting issue while POST/PATCH/PUT.
Kindly guide me how to resolve the cors issue.
Query : For testing purpose i used Third party MiddleWare . In My application i need to avoid that . Kindly guide is there any way to avoid the CORS issue without middle ware.

@siddharth23, this sounds like a deployment and http-proxy-middleware issue. as this falls likely outside of the scope of this forum, I’ll refrain from commenting on it.

@chunsiong.zoom
My bad apologies . I just want to know . I am facing CORS Issue while trying to call ZOOM REST API from my client side . Kindly guide me . How to Fix This?

@siddharth23 , you might want to search up some thread on this forum.
The API should be called from server side, calling it from client will throw CORS error.