Can't create Session with Error code 2014

Hello, i’m making a demo app with Video SDK.

I didn’t know it was changed to InstantSDK instead of VideoSDK, so I struggled a lot at first :frowning: Plz update api documentation…

Anyway, when trying to create a session, I don’t know what’s wrong.
The docs says, if no matching session, SDK will create session for me.

I create a JWT token like this with jjwt using kotlin.
Token is no problem when i checked in https://jwt.io/#libraries-io.

    val headers = HashMap<String, Any>().apply {
        put("alg", "HS256")
        put("typ", "JWT")
    }
    Timber.tag("JWT").d("headers : $headers")

    val payloads = HashMap<String, Any>().apply {
        putAll(
            arrayOf(
                "app_key" to sdkKey, "version" to 1, "user_identity" to userName,
                "iat" to iat, "exp" to exp, "tpc" to sessionName
            )
        )
    }
    Timber.tag("JWT").d("payloads : $payloads")

    val key = Keys.hmacShaKeyFor(sdkSecret.toByteArray())
    val jwt = Jwts.builder()
        .setHeader(headers)
        .setClaims(payloads)
        .signWith(key, SignatureAlgorithm.HS256)
        .compact()

    Timber.tag("JWT").d(jwt)

sdkKey is my app’s SDK Key, and sdkSecret is my app’s SDK secret.

                val sessionContext = ZoomInstantSDKSessionContext().apply {
                    sessionName = "mysession_oneboard"
                    userName = "ricky"
                    token = createJWT(sessionName, userName)
                    audioOption = ZoomInstantSDKAudioOption().apply {
                        connect = true
                        mute = true
                    }
                    videoOption = ZoomInstantSDKVideoOption().apply {
                        localVideoOn = false
                    }
                }
                zoom.joinSession(sessionContext)
                zoom.session?.run {
                    Timber.tag("Session").d("name : $sessionName")
                    Timber.tag("Session").d("password: $sessionPassword")
                    Timber.tag("Session").d("host : $sessionHost")
                    Timber.tag("Session").d("mySelf : ${mySelf.userName}")
//                    Timber.tag("Session").d("hostname : $sessionHostName")
                }

And this is the source code, when i use joinSession(). I know sessionName, userName, token are required, but i don’t find a problem. So add audioOption, videoOption

And my log says below.

D/JWT: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfa2V5IjoiVDBXRHlGM0gxaGxDMzBKRUsyc2ZUVzlTOXZ3Wm01ZVFRWU5vIiwidHBjIjoibXlzZXNzaW9uX29uZWJvYXJkIiwidXNlcl9pZGVudGl0eSI6InJpY2t5IiwiZXhwIjoxNjM2MzUzODI3LCJ2ZXJzaW9uIjoxLCJpYXQiOjE2MzYzMzk0Mjd9.bf0fXMNscPkxySM5DPFYNOm-UNGMksGMk7JKc_LFRlA
D/Session: name : mysession_oneboard
    password: null
    host : null
D/Session: mySelf : 
D/ZoomListener: onError(2014)
D/ZoomListener: onSessionLeave()

I found the error code 2014 means Errors_Session_Invalid_Param. But i don’t know what is problem.

I don’t know English well, so I’m sorry if I said it rudely.
Please solve it quickly. Thank you.

Hi @ricky.simp, thanks for using our SDK.

I didn’t know it was changed to InstantSDK instead of VideoSDK, so I struggled a lot at first :frowning: Plz update api documentation…

This is because the documentation is based on the latest version of the SDK. We are working on providing version-specific documentation in the future, but it may take some time for us to be able to do so. Could you please try downloading the latest version of the SDK from the Marketplace? I’m not seeing anything immediately obvious about your implementation that would be causing this, so maybe there is a bug in the version of the SDK that you are using now.

The only other potential issue I can think of is whether or not the JWT you are using was valid at the time of your test. The token you provided had an exp value of 1636353827 (in epoch time). Can you confirm that this error is still present when you are at a time greater than iat and less than exp?

I don’t know English well, so I’m sorry if I said it rudely.

Absolutely no problem, your post was very easy to understand and did not come off as rude! :slightly_smiling_face:

Thanks!

@jon.zoom
Thank you for replying. According to what you said, I thought my SDK version could be a problem.

Where can i download the latest version of the SDK?
I downloaded in Zoom Developer > My Apps > Select My App > download > Android latest SDK > 5.7.6.1918
But, i can’t find ’ ZoomVideoSDKInitParamsAnd, inMarketplacei can't find VideoSDK searching withvideo, session`…

If i’m wrong, plz teach me where can i download?

Thanks!

P.S.
from my jwt token when i first writing issue, i made iat by System.currentTieminMillis() / 1000 to make int. And exp made by int iat + 3600 * 4 (4 hours).
So, i decoded my jwt token in jwt.io. The result is as follows.

  "exp": 1636353827,
  "iat": 1636339427

iat is less than exp, and i made iat by System.currentTimeinMillis() / 1000. So, i think neither iat or exp is not problem.

@jon.zoom
Sorry, i read https://marketplace.zoom.us/docs/sdk/video/developer-accounts

:cold_sweat:My fault…
Bcuz I added Developer Account, so i skipped reading video sdk/developer-accouts.

I read carefully SDK documentation.

I think i found it.

I’ll try it whenever I have time and tell you.

I’m sorry, and Thank you.

When you read it, Have a nice day :smiley:

@jon.zoom

I checked.

EVERYTHING IS OKAY!!!

Thank you very much.

Have a nice day :smiley:

Thanks again from my side too…

That is great to hear that everything is working now!

Please don’t hesitate to reach back out in a new thread with any additional questions. :slightly_smiling_face:

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