Skip to content
Advertisement

can’t fetch msgraph data using vanilla js

I am trying to pull data from the endpoint https://graph.microsoft.com/v1.0/me/. I have done this using python but I can’t seem to fetch data from Microsoft Graph using vanilla js.

When I attempt to perform a fetch request. I get a 200 response but nothing is inside the response object.

Here is the fetch code:

JavaScript

I get a response of:

JavaScript

but I am expecting more of a response like the one I get from the https://developer.microsoft.com/en-us/graph/graph-explorer website like this:

JavaScript

Is there anything I am missing to get the data from msgraph using vanilla js only?

Advertisement

Answer

I figured it out – I needed to jsonize the data then print that data. Can’t believe I missed that. lol

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement