Creating upload session responds with 401. Application has 'Sites.ReadWrite.All' permission.

Kieran 1 Reputation point
2022-11-14T02:47:43.26+00:00

When I try create an upload session it fails with 401 unauthorised despite having the 'Sites.ReadWrite.All' permission. Reading the contents of the drive item does work.

const response = await axios.post(  
            `https://graph.microsoft.com/v1.0/users/${userId}/drive/items/${itemId}/createUploadSession`,  
            {  
                headers: {  
                    Authorization: `bearer ${token}`,  
                },  
            },  
        )  
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,409 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Kieran 1 Reputation point
    2022-11-14T14:26:03.5+00:00

    Hey, thanks everyone who replied. After further testing this issue only occurs when using axios to make the request.

    0 comments No comments