404获得delta时收到

时间:2017-10-19 14:41:45

标签: microsoft-graph onedrive sharepoint-api

从上周末开始,我在请求驱动器的更改列表时开始收到HTTP 404个响应。

首先我确保驱动器存在:

GET:

https://SOMEURL/sites/ASITENAME/_api/v2.0/drives/{id}/root

响应:

{
  <SNIP>
    "id": "01JGC6XP56Y2GOVW7725BZO354PWSELRRZ",
    "lastModifiedDateTime": "2017-08-05T22:16:24Z",
    "name": "root",
    "parentReference": {
        "driveId": "b!n5c5t3PkRUiChm70bDc96e2yqnYltoJLq6IT5lxQYDZqi7UosRqoRa_3kgIU8qaV",
        "driveType": "documentLibrary"
    },
       "folder": {
        "childCount": 5
    },
    "root": {},
    "size": 0
}

既然存在,我想我应该可以获得它的更改列表。我尝试使用驱动器api获取此驱动器的更改列表。

获取:

https://SOMEURL/sites/ASITENAME/_api/v2.0/drives/{id}/root/view.delta?token=3;%234;%231;3;28b58b6a-1ab1-45a8-aff7-920214f2a695;636434930370000000;67434848;%23;%23;%230

响应:

SPRequestGuid →b972249e-e00a-4000-8ed0-963ef7dba0e6
{
    "error": {
        "code": "itemNotFound",
        "message": "The resource could not be found."
    }
}

没有找到任何东西,这对我来说感觉不对。检查the docs,看起来格式已更改

使用最新的OneDrive文档(delta代替view.delta

获取:

https://SOMEURL/sites/ASITENAME/_api/v2.0/drives/{id}/root/delta?token=3;%234;%231;3;28b58b6a-1ab1-45a8-aff7-920214f2a695;636434930370000000;67434848;%23;%23;%230

响应:

SPRequestGuid →cf72249e-c0f7-4000-8ed0-97bf0cfaa584
{
    "error": {
        "code": "itemNotFound",
        "message": "The resource could not be found."
    }
}

/deltatoken=latest

一起使用

GET:

https://SOMEURL/sites/ASITENAME/_api/v2.0/drives/{id}/root/delta?token=latest

响应:

SPRequestGuid →eb72249e-e08d-4000-8ed0-94ad25d9e424
{
    "@odata.context": "https://SOMEURL/sites/ASITENAME/_api/v2.0/$metadata#items",
    "@odata.deltaLink": "https://SOMEURL/sites/ASITENAME/_api/v2.0/drives/{id}/root/view.delta(token='3;%234;%231;3;28b58b6a-1ab1-45a8-aff7-920214f2a695;636440196145030000;67696039;%23;%23;%230')",
    "@delta.token": "3;%234;%231;3;28b58b6a-1ab1-45a8-aff7-920214f2a695;636440196145030000;67696039;%23;%23;%230",
    "value": []
}

让我们试试Microsoft Graph API,看看是否有任何区别:

使用Microsoft Graph API:

获取:https://graph.microsoft.com/v1.0/drives/{id}/root/delta

响应:

client-request-id →34978ae4-57cf-44c2-b5aa-05b8271ab070
request-id →34978ae4-57cf-44c2-b5aa-05b8271ab070
x-ms-ags-diagnostic →{"ServerInfo":{"DataCenter":"East US","Slice":"SliceA","ScaleUnit":"003","Host":"AGSFE_IN_1","ADSiteName":"EST"}}
{
    "error": {
        "code": "itemNotFound",
        "message": "The resource could not be found.",
        "innerError": {
            "request-id": "dc105a6d-8f37-4865-bede-cbd875729af7",
            "date": "2017-10-19T14:26:47"
        }
    }
}

我发现one public issue与我遇到的情况非常相似。

我的问题是:

  1. /view.delta现在被视为已弃用?

  2. 如果我可以检索驱动器,在某种情况下,我应该在请求增量时获得404吗?

  3. 为什么使用?token=latest返回数据但没有它会返回404

2 个答案:

答案 0 :(得分:1)

这肯定是行为的回归,触发了具有验证公式所需列或列的文档库。我们正在努力修复并尽快部署它。

答案 1 :(得分:0)

您需要在端点前添加OneDrive.命名空间(有关详细信息,请参阅Direct Endpoint Differences: Namespaces)。

因此对于Delta端点,而不是调用:

/_api/v2.0/drives/{id}/root/delta

尝试拨打

/_api/v2.0/drives/{id}/root/oneDrive.delta

但是我对Microsoft Graph示例感到有些困惑。您的通话语法(/v1.0/drives/{id}/root/delta)是正确的。