Which graph api should I use to get metadata of "https://mydomain.sharepoint.com/:f:/t/SFDCAccounts/EjQ76JtPecJIvS1RuFOSCkABipyahnC20K4D_KyiZTny4w?e=OJed53"

Island Chen 0 Reputation points
2023-05-17T10:24:15.6933333+00:00

Hi everyone,

I have some URLs whose formats are like "https://mydomain.sharepoint.com/:f:/t/SFDCAccounts/EjQ76JtPecJIvS1RuFOSCkABipyahnC20K4D_KyiZTny4w?e=OJed53". They actually point to a SharePoint folder. I need to use the Graph API to get the metadata from this URL, for example, the folder path. The problem is that I don't know what "EjQ76JtPecJIvS1RuFOSCkABipyahnC20K4D_KyiZTny4w" refers to!

I tried to use it as a DriveItem or List identifier, but I received an "itemNotFound" error for both attempts. Which API should I use? I really appreciate any help you can provide.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,626 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,071 Reputation points Microsoft Vendor
    2023-05-18T06:17:08.7266667+00:00

    Hi @Island Chen

    You can use the following api to get the drives id

    https://graph.microsoft.com/v1.0/sites/siteid/drives
    
    

    Then you try following api to get all items in the root folder

    https://graph.microsoft.com/v1.0/me/drives/driveid/root/children
    
    

    The api will return you the url of the folder

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.