An API that connects multiple Microsoft services, enabling data access and automation across platforms
I recommend starting with Graph Explorer to test and construct your API requests before implementing them in your Java application.
Also, you can find sample code in Java in code snippet section.
To access the target site, drive, and folder items, follow these steps:
- Get Site ID
Retrieve your site details using the hostname and relative path:
GET /sites/{hostname}:/sites/{departmentname}
- Get Document Libraries (Drives)
List all drives under the site to locate your target drive-id:
GET /sites/{site-id}/drives
- Access Specific Folder or Item
Access items using the drive ID and folder path:
GET /drives/{drive-id}/root:/path/to/folder:/children
Permission Note: Ensure your application registration has the necessary delegated or application permissions (such as Files.ReadWrite.All or Sites.Selected configured with appropriate site access) if accessing items outside the standard user context.