Hi Mytoast Admin,
To export each file and folder URL from SharePoint Online, you can use the Microsoft Graph API. Specifically, you can use the following endpoint to get the webUrl
for all the files and folders in a specific drive:
GET https://graph.microsoft.com/v1.0/sites/{sitesId}/drives/{driveId}/root/children
This endpoint will return a list of items in the root of the drive, including their webUrl
properties. You can iterate through these items to collect all the URLs. Additionally, you can call GET /sites endpoint to fetch all the sites in your tenant and iterate over them to collect URLs of all the files & folders.
Make sure you have the necessary permissions (e.g., Sites.Read.All
) and an access token to authenticate your requests.
Please check the attached screenshot:
For more details, please refer https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.