【问题标题】:Get a DriveItem resource from shared folder by path通过路径从共享文件夹中获取 DriveItem 资源
【发布时间】:2023-03-27 08:56:01
【问题描述】:

全部。

我无法通过 OneDrive 服务的路径获取 DriveItem。

第一个请求:GET me/drive/root/children

      "remoteItem": {
    "id": "EF8A24CC458790DF!106",
    "parentReference": {
      "driveId": "ef8a24cc458790df",
      "driveType": "personal"
    }
  }

第二个请求:drives/ef8a24cc458790df/items/EF8A24CC458790DF!106/children

{  "value": [
{
  "parentReference": {
    "driveId": "ef8a24cc458790df",
    "driveType": "personal",
    "id": "EF8A24CC458790DF!106",
    "name": "src",
    "path": "/drives/ef8a24cc458790df/root:/onedriveapi/src"
  },
} ] }

但请求:/drives/ef8a24cc458790df/root:/onedriveapi/src 失败,代码为“itemNotFound”。

这必须有效: https://github.com/OneDrive/onedrive-api-docs/blob/live/docs/rest-api/api/driveitem_get.md

我的错误在哪里?

【问题讨论】:

  • 我试过了。有用。您能否为您的案件提供更多信息。我建议您检查您的“driveId”是否符合您的要求
  • @kikang,你需要什么信息?如果我把我的文件夹分享给你,你能给我文件的路径吗?
  • 我不需要你共享文件夹,因为那是你的信息,它会违反规则。我需要确认的是您是否在请求中传递了正确的“DriveID”。所以我建议你在不携带个人信息的情况下提供这两个请求的详细信息。

标签: microsoft-graph-api


【解决方案1】:

这是 API 中的错误。 对于非所有者情况,不允许从根目录直接路径。 https://github.com/OneDrive/onedrive-api-docs/issues/908

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-28
    • 1970-01-01
    • 2019-08-06
    • 2010-12-02
    • 2014-07-12
    • 1970-01-01
    • 2016-12-25
    相关资源
    最近更新 更多