Skip to content
Advertisement

Question for Accessing MS Graph Using Client Credentials One Drive?

I can’t seem to grasp my error

this is the result of the JSON return

{
"error": {
    "code": "UnknownError",
    "message": "",
    "innerError": {
        "date": "2022-03-16T13:43:15",
        "request-id": "7dc60220-68fb-411f-a3e7-9d2eac74483a",
        "client-request-id": "7dc60220-68fb-411f-a3e7-9d2eac74483a"
         }
    }
}

it’s not telling me anything

I don’t know what’s wrong,

I looked at the token and I have roles

by the way I have client_credentials token

 https://graph.microsoft.com/v1.0/drive/root/children

Update: I tried on https://developer.microsoft.com/en-us/graph/graph-explorer using this api https://graph.microsoft.com/v1.0/drive/root it works on that website,

But in postman it won’t work, is it because I used client credentials token?

Advertisement

Answer

You haven’t specified which drive to open. The URL should be like this for a user’s drive:

https://graph.microsoft.com/v1.0/users/{user-id}/drive/root/children

There are other examples on the documentation page. Note you cannot use /me as you are using client credentials, which means that the token does not identify a user. You must instead use /users/{user-id} for user drives.

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