What is the new way/method to implement OAuth for Glip Bot Apps in RingCentral Platform? (RingCentral Developer portal now has a way to get a permanent access token for Glip Bot Apps)
app.get('/oauth', function (req, res) {
if(!req.query.code){
res.status(500);
res.send({"Error": "Looks like we're not getting code."});
console.log("Looks like we're not getting code.");
}else {
platform.login({
code : req.query.code,
redirectUri : REDIRECT_HOST + '/oauth'
}).then(function(authResponse){
var obj = authResponse.json();
bot_token = obj.access_token;
console.log(obj);
console.log(bot_token);
res.send(obj)
subscribeToGlipEvents();
}).catch(function(e){
console.error(e)
res.send("Error: " + e);
})
}
});
The new method would be using
POST
instead of get as seen below