0
votes

I am unable to upload a file using a valid access token (the token allows me to list groups, drive items etc.). The error that appears is:

invalidRequest: One of the provided arguments is not acceptable.

Using the following PUT request: https://graph.microsoft.com/v1.0/groups/{my group id}/drive/items/{my item(folder) id}:/test.txt:/content

using content type: text/plain

I tested this exact same request using the graph explorer https://developer.microsoft.com/en-us/graph/graph-explorer and my office 365 user account and the upload worked, so I though it might be an app permissions thing, however this did not work even after granting absolutely every permission to the app and regenerating the access tokem. Please help as I would rather use an access token than my user account to perform the uploads.

Thankyou Oliver

2

2 Answers

0
votes

Just add a worked endpoint on my side:

PUT https://graph.microsoft.com/v1.0/groups/my-group-id/drive/root:/test.txt:/content

Request body: The contents of the file goes here.

The content type of request header does not need to be configured.

You need to check your folder path too.

0
votes

I managed to resolve by creating a new app definition in Azure AD with the same permissions and it worked! Perhaps there was some corruption in my original Azure application - maybe the manifest was corrupt (due to a bug)?