Hi @Anjali Shevadkar ,
According to this document, use the below Graph API Endpoint to fetch the Id of a SharePoint site by passing site name https://graph.microsoft.com/v1.0/sites?search={query}
Example Reference: Here 'test' is the site name for which we want the site-Id. Grant sites.read.all permission to call this API (please refer below example screenshot from Graph Explorer)
To fetch drive Id, these are the Endpoints you can use:
GET /groups/{groupId}/drives (To fetch the drives within a group)
GET /sites/{siteId}/drives (To fetch drives for a particular site)
GET /users/{userId}/drives (To fetch user's drives)
GET /me/drives (To list the current user's drive)
Example reference: To fetch drive Id of a particular site. Grant Files.Read permission for this API(please refer below screenshot from Graph Explorer)
Reference Docs:
https://learn.microsoft.com/en-us/graph/api/site-search?view=graph-rest-1.0&tabs=http#http-request
https://learn.microsoft.com/en-us/graph/api/drive-list?view=graph-rest-1.0&tabs=http
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".