Invalid sdkkey in my react app

Hi,

I keep getting - { method: “join”, status: false, result: “Invalid sdkkey.”, errorCode: 1, errorMessage: “Fail to join the meeting.” }

I am using the correct SDK key I got under sdk credentials in my app dashboard.
I am generating the signature using my php code below:

public function generateSignature(Request $request) {

    $key = env('ZOOM_API_KEY');
    $secret = env('ZOOM_API_SECRET');

     // Validate the JSON input
     $validatedData = $request->validate([
        'meetingNumber' => 'required|numeric',
        'role' => 'required|in:0,1', // 0 for attendee, 1 for host
    ]);


    $meeting_number = $validatedData["meetingNumber"];
    $role = $validatedData["role"];

    $token = array(
        "sdkKey" => $key,
        "mn" => $meeting_number,
        "role" => $role,
        "iat" => time(),
        "exp" => time() + 3600, //60 seconds as suggested
        "tokenExp" => time() + 3600,
    );
    $encode = \Firebase\JWT\JWT::encode($token, $secret, 'HS256');

    return response()->json(['signature' => $encode]);

    // return [
    //     'token'=>$encode
    // ];
}

How can i resolve this issue?

Hi @sendtoife
Thanks for reaching out to us and welcome to the Zoom Developer Community!
If you are using the meeting SDK, you should not be using API key and secret, you should be using client credentials

Here is our react sample app for meeting SDK

Hi,

Thanks for that, if that is the case and I have my client id and secret. how do i generate meeting number. I ask because the create meeting api requires a secret token which has been rejecting my client secret.

What do I do?

@sendtoife

Your sdkKey is Client ID
Your sdkSecret is Client Secret

You cannot generate a meeting number from Meeting SDK.
You need to use the REST API to create a meeting. This will give you a meeting number. Thereafter use Meeting SDK to join the meeting number,