Found a solution by calling the items instead of list items.
https://graph.microsoft.com/v1.0/me/drives/{driveid}/items?$filter=contains(webURL,'Documents/General')
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am listing all the items in a drive in order to get files and folder tree and the file id which are needed in my application.
Request:
https://graph.microsoft.com/v1.0/drives/{drive-id}/list/items?$select=webUrl
Example response:
{"webUrl": "https://wz68x.sharepoint.com/sites/Mark8ProjectTeam/Shared%20Documents/General/AAA.pptx"}
so this is mean the file is in the General channel.
but calling the previous request it retrieve all files and folder in response in that drive, with make it very slow with big response if the drive have many files. I want to only get a specific folder or a channel. by using filter but it doesn't work.
Ideal solution:
https://graph.microsoft.com/v1.0/drives/{drive-id}/list/items?$select=webUrl?$
is there a way to make the filter works or achieve the same result with a different method.
Found a solution by calling the items instead of list items.
https://graph.microsoft.com/v1.0/me/drives/{driveid}/items?$filter=contains(webURL,'Documents/General')