Can not start recording in react openvidu with laravel backend

I am using openvidu react with backend of laravel.
I posted startRecording successfully from react.
On laravel i am getting response from the openvidu start recording:

My laravel side code:

function createSession()
    {
        $sessionProperties = new SessionProperties(MediaMode::ROUTED, RecordingMode::MANUAL, OutputMode::INDIVIDUAL, RecordingLayout::BEST_FIT);
        $session = OpenVidu::createSession($sessionProperties);

        $tokenOptions = new TokenOptions(OpenViduRole::PUBLISHER);
        try {
            $token = $session->generateToken($tokenOptions);
        } catch (OpenViduException $e) {
            return response()->json(['error' => $e->getMessage()]);
        }
        return response()->json($token);
}

Start Recording Function:

public function startRecording(Request $request)
    {
        $request->validate([
            'session_id' => ['required'],
            'recording_name' => ['required']
        ]);
        $recordingProperties = new RecordingProperties($request->session_id, $request->recording_name, OutputMode::INDIVIDUAL, RecordingLayout::BEST_FIT, '1920x1080', true, true, "");
        $recording = OpenVidu::startRecording($recordingProperties);
        return response()->json(['recording' => $recording]);
    }

My recording properties:

session id is Mrnji2KWZPv6zl0Kavn6 recording name is rec_89 SquareetLabs\LaravelOpenVidu\RecordingProperties Object
(
    [session:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => Mrnji2KWZPv6zl0Kavn6
    [customLayout:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => 
    [hasAudio:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => 1
    [hasVideo:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => 1
    [name:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => rec_89
    [outputMode:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => INDIVIDUAL
    [recordingLayout:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => 
    [resolution:SquareetLabs\LaravelOpenVidu\RecordingProperties:private] => 
)

In response i am getting below 404 error:

  • 404 : no session exists for the passed sessionId parameter

You are not providing a valid “session” parameter on this call: OpenVidu Docs

404 means that the session body parameter is a session identifier that does not exits in openvidu-server.

@pabloFuente you mean to say i should provide the name of parameter as described in documentation rather than using my custom variable names ? And kindly note i am printing the value of session id in console and it is valid though…

rather than using my custom variable names ???

If you mean that if you should use the method parameter names as documented instead of making up your own parameter names to call those methods… then yes, you must follow the documentation.

But I’m not sure this is what you are asking… I think we are not understanding each other here.

Yes that is what i was asking. Thanks i will implement that as per documentation and if that works i will mark your reply as solution. Kindly don’t close this topic till tomorrow.