Hi @Kanwal Singh,
The 404 error usually occurs if you are using GET method instead of POST while fetching sensitivity labels for SharePoint file.
Initially I got the same error, when called the extractSensitivityLabels
API using GET:
To resolve the error, make use of POST and also make sure that you are passing the correct ItemID
:
Fetch Item ID:
GET https://graph.microsoft.com/v1.0/drives/DriveID/root:/Document.docx
- Also make sure to grant admin consent to Files.Read.All API permission.
I am able to fetch the sensitivity labels for SharePoint file successfully:
POST https://graph.microsoft.com/v1.0/sites/SiteID/drive/items/ItemID/extractSensitivityLabels
Note that for emails, currently fetching sensitivity labels for mails is not supported for the endpoint https://graph.microsoft.com/v1.0/me/messages
using Microsoft Graph API.
- You can raise a feature request for the same, Refer this Fetch mail sensitivity label using the Graph API - Microsoft Q&A
Reference:
driveItem: extractSensitivityLabels - Microsoft Graph v1.0 | Microsoft
Hope this helps!
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful, which may help members with similar questions.
If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.