Forum Discussion
Unable to upload (overwrite) a AIP (sensitivity label) document in SharePoint
I tried to overwrite a document using the Graph API.
https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0
Sensitivity label document overwrite failed.
(Sensitivity label document overwrite was successful through SharePoint in the web browser.)
UploadSession was created successfully.
| Request | POST /sites/{site-id}/drive/items/{item-id}/createUploadSession |
| Response | 200 OK { |
But upload using session failed.
| Request | PUT https://socamresearch.sharepoint.com/sites/test111/_api/v2.0/drive/items/014IDU5ZIHHNOKSWVRN5DZFC2P4JN4DSJ3/uploadSession?guid='376ecb70-d9a4-4cec-a532-23333b75a3e9'&dc=0&tempauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvc29jYW1yZXNlYXJjaC5zaGFyZXBvaW50LmNvbUA0ZDYxNWFmOS0xZDA0LTRiY2MtOGU2Zi1jNmI2ZmUzMTEwZGQiLCJpc3MiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAiLCJuYmYiOiIxNzAwMDE1NjI1IiwiZXhwIjoiMTcwMDEwMjAyNSIsImVuZHBvaW50dXJsIjoiTSs3UWxmNHVpLzFIa2Zrd3FRRW5NTCs0anhiZmNlQ0JKalVxWjRqNTMrVT0iLCJlbmRwb2ludHVybExlbmd0aCI6IjE2NyIsImlzbG9vcGJhY2siOiJUcnVlIiwiY2lkIjoidWlabkRPbkZBa1d2WEZ6Ri9LdXNOZz09IiwidmVyIjoiaGFzaGVkcHJvb2Z0b2tlbiIsInNpdGVpZCI6Ik1qSTRNMlpsTnpJdFlUTXdaaTAwWW1JMkxUaGpNMk10TXpCbE0yUmlORE0xWlRWaSIsImFwcF9kaXNwbGF5bmFtZSI6IlNlY3VyaXR5MzY1IiwibmFtZWlkIjoiN2U4MmU3MGQtNDM4Ni00MTlkLTlkZmQtNmM4ZDZlNjA2OGZjQDRkNjE1YWY5LTFkMDQtNGJjYy04ZTZmLWM2YjZmZTMxMTBkZCIsInJvbGVzIjoiZ3JvdXAucmVhZCBhbGxzaXRlcy5yZWFkIGFsbGZpbGVzLndyaXRlIGFsbHByb2ZpbGVzLnJlYWQiLCJ0dCI6IjEiLCJpcGFkZHIiOiIyMC4xOTAuMTQ0LjE3MiJ9.BD4TUMNYSuoQxs2im4gf17Q3m01OLEXIYUTNI9UgTTU {file content} |
| Response | 403 Forbidden { "error": { "code": "notAllowed", "message": "This operation has been disabled by policy" } } |
Only sensitivity label documents in SharePoint failed.
(The document without sensitivity label is uploaded(overwrited) successfully through the graph API.)
I referred to the URL below but couldn't find the answer I needed.
https://learn.microsoft.com/en-us/answers/questions/1135853/graph-api-unable-to-upload-the-content-of-file-whe?page=1
https://feedbackportal.microsoft.com/feedback/idea/366eac68-c185-ed11-a81b-6045bdaf6a9e
An error message occurred: "This operation has been disabled by policy"
What is this policy?
Is there a way to change the policy?
How do I overwrite a document with sensitivity label using the Graph API?
Thank you