Description
I’m creating an app that should let me create webinars on my account.
my app is written in node js and I’m trying to use my resource on zoom through the API. when I’m trying to create the bearer token using:
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'zoom.us',
'path': '/oauth/token?grant_type=client_credentials',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Basic Shhh',
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
I’m getting the bearer token correctly.
But when I try to use this token to access my resources using:
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.zoom.us',
'path': '/v2/accounts',
'headers': {
'Authorization': 'Bearer Shhhh',
'Content-Type': 'application/json',
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({"first_name":"xxx","last_name":"xxx","email":"yyy@zz.ww","password":"QQQQQ"});
req.write(postData);
req.end();
I’m getting the error response:
Error
status code: 400
{
"code": 200,
"message": "Invalid API key or secret."
}
Which App Type (OAuth)?
- OAuth
Which Endpoint/s?
- /oauth/token
- all other endpoint
How To Reproduce (If applicable)
described above
Screenshots (If applicable)
none
Additional context
Note: the app works only on the server-side and without client-side.
therefore: there is no user to redirect or website URL etc