I used labels and policies in Data Governance. After I auto-published the label, I see the individual files in OneDrive getting tagged with a label.
I need to programmatically check if there are any labels associated with the file and categorize them. I don't see the labels data while querying through Graph as well.
https://graph.microsoft.com/v1.0/me/drive/root/children/test.txt
Do we have any powershell commands or REST API to get these data in granular level?
Thanks, Madhan
Have you tried this for retrieving LabelActivity:
For your first question on retrieving Labels from Graph, you can try the below query to check if it provides label info. I haven't tried myself.
GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}?expand=fields
You can constructSharePointId using the information from SharePointIds from the query below: https://graph.microsoft.com/v1.0/drive/root/children?$select=Name,sharepointIds