I'm trying to integrate videocalls into my website using Parse and TokBox (OpenTok). I have found this great tutorial with complete code in github, it creates sessions without problems, but fails to fetch the session ID and pass it to the generateToken function. The result is
b.Error {code: 141, message: "You must specify a sessionId to generate a token"}
When I replace request.params.sessionId || ''
with existing session ID in
var token = opentok.generateToken(request.params.sessionId || '', request.params.options);
it generates the token. I created code to save session ID in an Object, but the code to get this data from the cloud and pass it into GenerateToken function fails to execute (although it executes from plain js).
Please, answer if you have any considerations regarding the following questions:
How does
request.params.sessionId
work? How does it know where to take the data?How and where to pass parameters to request.params.options (it will be needed later)?
Is querying object data from cloud code different from querying from plain js?
How to pass the generated sessionID to the generateToken function correctly?