Share via

MS Graph Explorer, My endpoint List all OneDrive Files in a folder only shows Sub Folder names

Darryl Baker 20 Reputation points
2024-08-24T16:23:26.2366667+00:00

in MS Graph explorer I use this endpoint https://graph.microsoft.com/v1.0/me/drive/root:/xBackup/movies:/children

I expect the result to include all the file names under the "xBackup/Movies" directorie, including sub directories; however it only list the names of the sub directories and not file names.

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | OneDrive | For business | Windows
Microsoft Security | Microsoft Graph

Answer accepted by question author

  1. Anonymous
    2024-08-26T02:29:35.7166667+00:00

    Hi @Darryl Baker

    Thank you for sharing the solution, but because the rules restrict you from tagging the answers you post, so to help more people with similar questions, I will quote your content below, please click "Accept the answer" so that more people can see it.

    Question:

    Use this endpoint in MS Graph Explorer.

    https://graph.microsoft.com/v1.0/me/drive/root:/xBackup/movies:/children

    Expect the result to include all the file names under the "xBackup/Movies" directorie, including sub directories; however it only list the names of the sub directories and not file names.

    Solution:

    4 separate endpoints - one for each bottom child directory. such as Parent root/- Child 1, Child 2, Child 3, Child 4} ie xBackup/movies - {Movies - Listened to, 2,3,4}

    1. MS Graph Explorer doesn't support Multi level children ie https://graph.microsoft.com/v1.0/me/drive/root/children?$expand=children Error if Multi level children
    2. Get list of all sub directory names:-https://graph.microsoft.com/v1.0/me/drive/root:/xBackup/movies:/children?select=name
    3. Finally, had to do 4 separate queries, one for each of my sub directories: Used https://graph.microsoft.com/v1.0/me/drive/root:/xBackup/movies/Movies - Listened to:/children?$Select=name Returned list of filename and extension

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.