0

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

JuChom
  • 5,717
  • 5
  • 45
  • 78
  • Although I don't have permissions for getting the /applications, am getting same insufficient privilege error in both versions ? is this happening only for /applications or all the beta/* urls ? – Muthurathinam Mar 12 '19 at 07:10
  • all beta urls are not working I think. I tried a few and got nothing. – JuChom Mar 12 '19 at 13:31
  • 1
    its working fine with my environment. I have tried with "/me". Can you verify with the "/me" ? Can you help me in reproducing the issue by your request environment ? if its in node then the node version or if it is in browser environment, then by the browser name and its version? – Muthurathinam Mar 14 '19 at 08:57
  • I've updated my post – JuChom Mar 14 '19 at 13:19
  • Can you share error message in the 404? please remove PI information if any. – Muthurathinam Mar 15 '19 at 04:45

0 Answers0