-1

I am trying to figure out the maximum length of the ID of the Office 365 item. E.g. there is DirectoryObject resource type https://learn.microsoft.com/en-us/graph/api/resources/directoryobject?view=graph-rest-1.0. It has an ID field but the maximum length of this field is not mentioned anywhere.

Similarly, for Exchange online we have mailbox IDs. Is there any document that mentions the maximum length of these Office 365 items (DirectoryObject, Drive, DriveItem, Teams/Channel ID, Mailbox, etc.) Or if there any programmatic way of figuring out the maximum length? Please let me know.

user13260866
  • 131
  • 1
  • 2
  • 9

1 Answers1

0

There is no specified maximum length. You can't assume anything.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • But if I have to store this in DB what length I should assume for the field? – user13260866 Aug 19 '21 at 17:00
  • Keeping the entry ID in the Db is really not a good idea. The item ID can be changed if the item is moved to another folder/store. Consider using something like search ID instead. Try to play with IDs and you will find how much characters you need. – Eugene Astafiev Aug 19 '21 at 17:08
  • If your going to store Id's in a database make sure you store the Immutable which doesn't change we an item is moved https://learn.microsoft.com/en-us/graph/outlook-immutable-id. The format for the Id's is opaque (not documented) so defining an exact length for them is probably not a good idea. – Glen Scales Aug 19 '21 at 23:48