We have an application that shows a list SharePoint documents in a given document library and folder. Is there a way to get a list of documents in a folder, with the Description metadata value? Feels like it should be easy enough to do. Here is a summary of what I've tried so far. Thanks for any help.
Getting the list works fine, using...
https://graph.microsoft.com/v1.0/drives/{driveId}/list/items?expand=driveItem(select=name,id,description)
...but that lists all the items in the {driveId}.
I can limit the result by using a {folderPath}, but that does not support the expand= option, which means I can't get the Description value...
https://graph.microsoft.com/v1.0/drives/{driveId}/root:/{folderPath}:/children
Adding a filter= option is accepted by the API call, but answers the full unfiltered list...
https://graph.microsoft.com/v1.0/drives/{driveId}/list/items?expand=driveItem(select=name,id,description)&$$filter=parentReference/id eq '{folderId}'
I can use a query, but I have not been able to include the Description metadata value in the result. And it only supports delegated permissions, but need to use application permissions. This gives the correct result, minus the Description value...
https://graph.microsoft.com/v1.0/search/query
{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "isDocument=true AND path:\"{document path}""
}
}
]
}
Got this reply from Microsoft on the learn.microsoft.com site...