In my document library, I have a folder that contains file A, and a subfolder, which contains file B.
I am able to get custom metadata fields from file A by file name and document library id, using: https://graph.microsoft.com/v1.0/drives/{driveId}/root:/{fileA name}/listItem/fields
But I am failing to get custom metadata fields from file B by name. I know you can use the itemId of the file to get its metadata, like so: https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/listitem/fields
But I want to get the metadata of file B via its fileName. I have tried to find the proper endpoint but couldn't find any from the documentation.
These were my attempts that all failed:
https://graph.microsoft.com/v1.0/drives/{driveId}/items/{folderId}/root:/{fileB name}/listItem/fields
https://graph.microsoft.com/v1.0/drives/{driveId}/items/{folderId}/children/root:/{fileB name}/listItem/fields
https://graph.microsoft.com/v1.0/drives/{driveId}/items/{folderId}/children/root:/{fileB name}/listItem/fields
Any help with this would be appreciated.