excel – Get Graph Drive Id from SharePoint library name

I’m trying to use some graph endpoints in a Flow to access a file in a library that isn’t the default Documents library. I need to get the graph id for a file. All I’m starting with are the obvious things about the file, site, library name, filename, path to file, etc.

In order to get the file id I found I need to send a request to {sharepoint-site}/_api/v2.0/drives/{drive-id}/root:/{filename}. I have the filename, but I don’t have the drive id.

All the tutorial and documentation I’m finding say something along the lines of “…/drive accesses the site’s Documents library, if you want to access a different library you will need to use /drives/{drive-id}…” or “…once you have the drive id, then you use this endpoint…”

I can do something like {site}_api/v2.0/drives?$select=id,name which will return all the document libraries in the site and then iterate through those looking for the name or path of the library. But that seems like a lot of extra work.

I tried to append a &$filter=name eq '{library-name]' but that didn’t make a difference it just listed all the libraries.

Is there really no way just to get just the drive id for one library? How do I get the drive id based on the path/name of a library?