Help understanding how to create meeting using backend

hey bro
can you help me in create meeting bro i’m confused that i have run a zoom-api-jwt-master sample app and i got this


Now what next i should do now i can’t understand please help me.

Hi @junaidali9559 , basically you need to copy and paste the example code from @gabriel.rf0 in the index.js file and replace the line
email = "your maketplace developer email"; with your email.
then change
<form action="/userinfo" method="post">
to
<form action="/newmeeting" method="post">
in the public/index.html file
Then go to localhost:3000/newmeeting and you will get the JSON response with the created meeting information printed.

1 Like

Hi @le.oviedo, after doing all this i get this error now image
after adding @gabriel.rf0 code snippet my index.js file code is this

//include required modules
const jwt = require(‘jsonwebtoken’);

const config = require(’./config’);
const rp = require(‘request-promise’);

const express = require(‘express’);
const app = express();

app.use(express.urlencoded({ extended: true }));
app.use(express.static(‘public’));
var email, userid, resp;
const port = 3000;

//Use the ApiKey and APISecret from config.js
const payload = {
iss: config.APIKey,
exp: ((new Date()).getTime() + 5000)
};
const token = jwt.sign(payload, config.APISecret);

//get the form
app.get(’/’, (req,res) => res.send(req.body));
app.post("/newmeeting", (req, res) => {
email = “junaidali9559@gmail.com”;
var options = {
method: “POST”,
uri: “https://api.zoom.us/v2/users/” + email + “/meetings”,
body: {
topic: “test create meeting”,
type: 1,
settings: {
host_video: “true”,
participant_video: “true”
}
},
auth: {
bearer: token
},
headers: {
“User-Agent”: “Zoom-api-Jwt-Request”,
“content-type”: “application/json”
},
json: true //Parse the JSON string in the response
};

rp(options)
.then(function(response) {
console.log("response is: ", response);
res.send("create meeting result: " + JSON.stringify(response));
})
.catch(function(err) {
// API call failed…
console.log("API call failed, reason ", err);
});
});

//use userinfo from the form and make a post request to /userinfo
app.post(’/userinfo’, (req, res) => {
//store the email address of the user in the email variable
email = req.body.email;
//check if the email was stored in the console
console.log(email);
//Store the options for Zoom API which will be used to make an API call later.
var options = {
//You can use a different uri if you’re making an API call to a different Zoom endpoint.
uri: “https://api.zoom.us/v2/users/”+email,
qs: {
status: ‘active’
},
auth: {
‘bearer’: token
},
headers: {
‘User-Agent’: ‘Zoom-api-Jwt-Request’,
‘content-type’: ‘application/json’
},
json: true //Parse the JSON string in the response
};

//Use request-promise module’s .then() method to make request calls.
rp(options)
.then(function (response) {
//printing the response on the console
console.log(‘User has’, response);
//console.log(typeof response);
resp = response
//Adding html to the page
var title1 ='

Your token:


var result1 = title1 + ‘
’ + token + ‘
’;
var title =‘

User’s information:


//Prettify the JSON format using pre tag and JSON.stringify
var result = title + ‘
’+JSON.stringify(resp, null, 2)+ ‘

res.send(result1 + ‘
’ + result);
})
.catch(function (err) {
    // API call failed...
    console.log('API call failed, reason ', err);
});

});

app.listen(port, () => console.log(Example app listening on port ${port}!));

What should i do now please help me.
Thanks

Hi @junaidali9559, open public/index.html
then change
<form action="/userinfo" method="post">
to
<form action="/newmeeting" method="post">
and it should work

1 Like

hi @le.oviedo yes its working now thank you!
But what should i do next now i want this to run with web sdk on my company website. What should i do please help me!

1 Like

Hey @junaidali9559,

Happy to hear you got it working! @le.oviedo thanks for your help! :slight_smile:

@junaidali9559, you can take the code from our sample app and put it on your website, or follow the guide here: https://www.npmjs.com/package/@zoomus/websdk

Thanks,
Tommy

Yes I created that meeting but how can I send the invitation via email to users?

Hey @maheshwaripatil7777,

The only way to send an invitation email to users is with the Add Meeting Registrant API.

Otherwise you will have to use a 3rd party email API like SendGrid.com.

Thanks,
Tommy

hello tommy,

how to list meeting details of zoom using node.js or java or php?

any one technology is highly appreciate.

Hey @prembritz, you can utilize our GET Meeting endpoint to fetch Zoom meeting details. In the linked documentation, you’ll also find an embedded Postman tool with a code generator for Node, Java, PHP, etc.

If you have further questions, please create a new post in #zoom-api.

Thanks,
Will

Is there any way of creating zoom meet link without ApiKey and APISecret. Or any other way to create meet link just with emailid without configuring anything

Hey @akshay.salekar,

Can you clarify your use case so I can help? You can get your Zoom meeting link on zoom.us as well. :slight_smile:

Thanks,
Tommy

Hey Thank you for reply,
I wanted to ask is there anyway to create a api key and secret key for on organization so that I can use the same api key and secret key for all users of that organization to create meeting link using node js backend.

Hey @akshay.salekar,

Thank you for providing additional information. The Web SDK is not able to create meetings, instead, it’s best used when joining meetings. You can use the Create a Meeting API in order to programmatically create a meeting but this requires that you use a separate OAuth or JWT app and therefore, separate credentials to authenticate with.

I hope that helps! Let me know if you have any questions.

Thanks,
Max

How long does this meeting last and how can the term be terminated early?

Hey @askary.almazan,

Checkout this document for length of Zoom meetings:

Let me know if you need more info.

And you can end the meeting early by clicking the End Meeting button, or with the Zoom API if you are building an integration of some sort. :slight_smile:

Thanks,
Tommy

I have one more query in which I want your help. So If I want to serve different clients with different domain urls do I need to create different zoom applications? Let say I have two clients , one with url abcd.mywebsite.com and other as xyz.mywebsite.com . If I am not mistaken our redirect url must contain this domain in order to match the route. So Is it possible in one app or I must create different applications for different clients.

Hey @akshay.salekar,

Great question! Instead of creating multiple apps, you can whitelist multiple URLs and when you call the OAuth endpoints, you can change the redirect_uri to what you want to use for that particular domain.

I hope that helps! Let me know if you have any questions.

Thanks,
Max

Hi Guys!

I tried to create a meeting with the previous nodejs example and other examples in the web but when I call to http://localhost:3000/newmeeting I’m getting the following error:

"statusCode":401,
   "message":"401 - {"code":124,"message":"Invalid
access token."}",
   "error":{
      "code":124,
      "message":"Invalid access
token."
   }

Thanks in advance

how to predefine which emails are allow to join meeting early when creating meeting?