Forum Discussion

swamisnawale's avatar
swamisnawale
Copper Contributor
Oct 04, 2023

Get Documents only using graph api

Hi All, 

 

I'm using Graph API to access user's recent files

Reference: https://learn.microsoft.com/en-us/graph/api/drive-recent?view=graph-rest-1.0&tabs=http

 

Here I'm getting all types of files but I dont want image files. How do I filter out the response to exclude all image files and get only documents like word, ppt, excel, etc... I'm build a custom component similar to Recent documents (SharePoint OOTB component)

I'm using https://graph.microsoft.com/v1.0/me/drive/recent

 

 

 

  • swamisnawale You can try using $filter based on file name, webUrl or mime type with endsWith or eq operators.

     

    Check: Use the filter query parameter in Microsoft Graph API


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources