
Hi @Manohar onmi
As far as I know, there is no way to filter out folders directly via the search API, you can only check if the object in the response contains a folder
property. In the response, folders will have a folder
property, but files will not. You can filter out folders by checking this property. Here is an example response:
{
"value": [
{
"name": "Folder1",
"folder": {} // This indicates it's a folder
},
{
"name": "File1",
"file": {} // This indicates it's a file
}
]
}
If you only want to get folders, then I recommend using the Drive API.
GET /me/drive/root/children?$filter=folder ne null
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.