unauthenticated while trying to get onedrive data via Microsoft Graph

Marc Rosenbaum 96 Reputation points
2021-01-07T12:19:43.447+00:00

hi everyone,
i am using an office365 family account. Now i am trying to access my files in onedrive via graph api. My first try is using the deviceflow example from Microsoft (device_flow_sample.py). If i am trying to access my accountdata this is working well (endpoint "https://graph.microsoft.com/v1.0/me"). After this i tried to access onedrive (endpoint "https://graph.microsoft.com/v1.0/me/drive"). But then i got an 401 ("unauthenticated") as a response. I though that i am using the wrong authority-url for my account but then i tried it with the graph-explorer (https://developer.microsoft.com/de-de/graph/graph-explorer) and i got the same result.

Is it possible to access onedrive with a office365 family account? I didnt found a good ressource whitch type of Microsoftaccount is able to access which ressource. I would be very thankful if someone can give me a hint.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,043 questions
{count} votes

Accepted answer
  1. Marc Rosenbaum 96 Reputation points
    2021-01-07T15:05:47.507+00:00

    Hi Shiva,
    thanks for your reply. In the meantime i found the solution. It was not a authenticationproblem but a authorizationproblem. My Sessiontoken was correct and the permission in the azureportal too. But in my code i requested to less permission....

    Thank you for your trouble.

    Greetings Marc


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.