I'm having a problem adding user permission to a specific file on Sharepoint, and I've tried with both UI and API approach.
UI approach: It shows "Access granted", but the user is not in the access list.
API approach: I use POST /drives/{drive-id}/items/{item-id}/invite API (document) to add permission, and double check with GET /drives/{drive-id}/items/{item-id}/permissions API (document). However, the user I tried to add is not in the response permission list. Details as follows:
Add request (postman):
request:
request method: POST
request-id: 25a0a09c-9c1b-4b8d-9e83-905e2cb56541
body:
{ "requireSignIn": true, "sendInvitation": false, "roles": [ "write"], "recipients": [ { "email": "e2e_team_member_1@synologybat.onmicrosoft.com" } ] }
response:
status: 200 OK
response body:
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(permission)", "value": [ { "@odata.type": "#microsoft.graph.permission", "id": "aTowIy5mfG1lbWJlcnNoaXB8ZTJlX3RlYW1fbWVtYmVyXzFAc3lub2xvZ3liYXQub25taWNyb3NvZnQuY29t", "roles": [ "write" ], "grantedTo": { "user": { "email": "e2e_team_member_1@synologybat.onmicrosoft.com", "id": "016131d5-af3d-45c7-927e-8efb816df327", "displayName": "e2e_team_member_1" } } } ] }
List request (postman):
- request:
- request method: GET
- request URL: https://graph.microsoft.com/v1.0/drives/b!B9_4qng1vEG8jqkTAC9MmAsztZ4HlLlDhKKjGSWXmyD47-FwHKeYSrnKXA21cQU-/items/01UHBHMTQDBABLHYKCP5EKEMHX6KZPMDK3/permissions
- request-id: 16fd1b67-4bab-41af-886a-349922d86c6f
- response: 200 OK, but the target user in Add request is not in the response body.
- request:
I'm curious that is there something I missed or if it is a temporary issue on Microsoft. I would appreciate it if someone can help me with it, thank you.