How unique is a drive item-id in the ms graph api?

R Depping 10 Reputation points
2024-09-17T13:51:52.9033333+00:00

What guarantees does the graph API offer regarding the uniqueness of a drive item-id?

reference - https://learn.microsoft.com/en-us/onedrive/developer/rest-api/resources/driveitem?view=odsp-graph-online

Is a drive item-id unique:

  1. within a drive
  2. within a site
  3. within a tenant
  4. globally/universally unique
  5. something else

We want to globally uniquely identify a drive item in our own data store. We think we might have to store a drive-id with the item-id to uniquely identify it. But are looking for confirmation.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,113 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,128 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yakun Huang-MSFT 5,415 Reputation points Microsoft Vendor
    2024-09-18T09:03:40.6333333+00:00

    Hi @R Depping

    Yes, the drive item-id is unique in the world, each item in OneDrive or SharePoint has a unique identifier that distinguishes it from all other items, ensuring that each file or folder can be individually accessed and managed regardless of its location or ownership.

    Hope this helps.

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


  2. Rohit Raghuwanshi - MSFT 475 Reputation points Microsoft Vendor
    2024-09-18T09:07:02.1433333+00:00

    Hi R Depping,

    Thank you for reaching out, Microsoft!

    Please refer the below doc which clearly mentions property id is unique identifier of the item within the Drive.
    User's image

    https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0#properties

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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.