I'm having trouble to use the beta api of Microsoft Graph.
Running this code on v1.0 works fine
var AuthenticationContext = require('adal-node').AuthenticationContext;
var MicrosoftGraph = require("@microsoft/microsoft-graph-client");
require("isomorphic-fetch");
var client = MicrosoftGraph.Client.init({
//defaultVersion: 'beta',
authProvider: function (done) {
done(null, 'mytoken');
}
});
client
.api('/users')
.version('v1.0')
.get()
.then(function (res) {
console.log(res);
})["catch"](function (err) {
console.log(err);
});
Running this code on beta doesn't work. There is no output at all, no error, no response...
var AuthenticationContext = require('adal-node').AuthenticationContext;
var MicrosoftGraph = require("@microsoft/microsoft-graph-client");
require("isomorphic-fetch");
var client = MicrosoftGraph.Client.init({
//defaultVersion: 'beta',
authProvider: function (done) {
done(null, 'mytoken');
}
});
client
.api('/applications')
.version('beta')
.get()
.then(function (res) {
console.log(res);
})["catch"](function (err) {
console.log(err);
});
If I call the beta/applications endpoint with postman it works.
Do you have any idea why is this happening and why I'm not having any output.
UPDATE
NPM package 1.5.2 is not working. 1.4.0 is working...
UPDATE 2
I authenticate as an application, so doing /beta/me is giving back a 404.
I'm using node v11.11.0