OneDrive For Business:如何在按路径访问项目时克服 MaxUrlLength 问题?
OneDrive For Business: How do I overcome the MaxUrlLength issue while accessing an item by its path?
我的主要objective是检索文件的ID。
场景如下
我需要访问文件的元数据,但我只有文件路径(我不能使用 /drive/items/{item-id} 方法)
当路径变得太大时,我无法访问元数据。
https://tenant-my.sharepoint.com/personal/some_user_some_domain_elasticadev_com/_api/v2.0/drive/root:/mauze/test/This is supposed/This is really supposed to be a really long name for a folder which normally isn't the case!/SomeName-123456789012345678901234567890123456789012345678901234567890123456789012.txt
错误
401 Unauthorized
The length of the URL for this request exceeds the configured maxUrlLength value.
在使用 Sharepoint Online API 时,我曾经使用 URL 参数来解决这个问题,例如
https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/startupload(uploadId=guid'bla-bla')?@v='/personal/user_account_tenant_onmicrosoft_com/Documents/Test/reeeaaaaallllyyybiiignameblablblalblalb.txt'
我无法将此技术用于 OneDrive API。有什么解决办法吗?
附带问题,我确实有文件的 ListItemUniqueId(Sharepoint 上文件的 UniqueID)
我能以某种方式使用它来将其转换为 OneDrive ID 吗?为此目的的任何方面?即,SharepointIds Facet.
的反转
您应该能够对 OneDrive 使用类似的别名方法 API,但在别名命名方面可能不那么灵活。
https://tenant-my.sharepoint.com/personal/some_user_some_domain_elasticadev_com/_api/v2.0/drive/root:@path?@path='/mauze/test/This%20is%20supposed/This%20is%20really%20supposed%20to%20be%20a%20really%20long%20name%20for%20a%20folder%20which%20normally%20isn''t%20the%20case!/SomeName-123456789012345678901234567890123456789012345678901234567890123456789012.txt'
话虽如此,我们现在确实应该支持该长度的 URL,因此我需要跟进以了解这方面出了什么问题。
我的主要objective是检索文件的ID。
场景如下
我需要访问文件的元数据,但我只有文件路径(我不能使用 /drive/items/{item-id} 方法)
当路径变得太大时,我无法访问元数据。
https://tenant-my.sharepoint.com/personal/some_user_some_domain_elasticadev_com/_api/v2.0/drive/root:/mauze/test/This is supposed/This is really supposed to be a really long name for a folder which normally isn't the case!/SomeName-123456789012345678901234567890123456789012345678901234567890123456789012.txt
错误
401 Unauthorized
The length of the URL for this request exceeds the configured maxUrlLength value.
在使用 Sharepoint Online API 时,我曾经使用 URL 参数来解决这个问题,例如
https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/startupload(uploadId=guid'bla-bla')?@v='/personal/user_account_tenant_onmicrosoft_com/Documents/Test/reeeaaaaallllyyybiiignameblablblalblalb.txt'
我无法将此技术用于 OneDrive API。有什么解决办法吗?
附带问题,我确实有文件的 ListItemUniqueId(Sharepoint 上文件的 UniqueID) 我能以某种方式使用它来将其转换为 OneDrive ID 吗?为此目的的任何方面?即,SharepointIds Facet.
的反转您应该能够对 OneDrive 使用类似的别名方法 API,但在别名命名方面可能不那么灵活。
https://tenant-my.sharepoint.com/personal/some_user_some_domain_elasticadev_com/_api/v2.0/drive/root:@path?@path='/mauze/test/This%20is%20supposed/This%20is%20really%20supposed%20to%20be%20a%20really%20long%20name%20for%20a%20folder%20which%20normally%20isn''t%20the%20case!/SomeName-123456789012345678901234567890123456789012345678901234567890123456789012.txt'
话虽如此,我们现在确实应该支持该长度的 URL,因此我需要跟进以了解这方面出了什么问题。