We are developing an web app, deploy to SharePoint online using SharePoint designer. It has this functionality: only office files (docx, xlsx, pptx) with appropriate sensitivity label are allowed to upload to a SharePoint online document library.
We are following this guide: [login to view URL] We call _api/web/lists/getByTitle('<name>')/items(<id>)/FieldValuesAsText and check the MetaInfo field of the response.
The issue is, the API sometimes response with no info of the sensitivity label of the file, for unknown reason.
We want a better solution to detect the sensitivity label of the uploaded file, with the following criteria:
1. No additional server needed
2. If the solution need additional APIs, we can deploy to Azure Function (NodeJS or C# environment).
If you have a solution for this, please contact us.