
Hello Patil, Vinod V
Thanks for reaching out!
To get the item-ID of a file that is present in a multi-subfolder level using Graph API, you need to list children of a drive and traverse through the folder structure by using '/children' endpoint. This needs to be done recursively to reach the target folder (The item-ID needs to be replaced with lower-level folder (Item-ID)). The response will have id, name of items and other details. You can identify whether an item is a folder or a file by looking for "files" or "folder" property for that specific Item in response. Refer drive Items resource.
To list children in the root of the current user's drive: This will list all the items (folders and files) along with the Item-IDs present in drive at root level.
GET /me/drive/root/children
To list children of a DriveItem with a known path: This returns the list of items in the children collection of the target item. Refer this.
GET /drives/{drive-id}/root:/{path-relative-to-root}:/children
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.