我需要从 SharePoint Online 中的 SitePages 库中获取 SitePages 的缩略图。我目前的方法是使用这个 URL: https://graph.microsoft.com/v1.0/sites/ {siteId}/lists/{listId}/items/31/driveItem/thumbnails/0/large/content
在 Postman 中使用 Graph Explorer 或 Delegated App Access 效果很好并返回图像。但是,使用 App Access Token 我得到一个未知错误,看起来像这样:
"error": {
"code": "generalException",
"message": "[OneDrive.Media.Streams] e:\\source\\repos\\mediaprocessingcomponents2\\streams\\streamonuriimpl.cpp(647) *** HTTP 500 ***\r\n*** RAWURL ***\r\n{someUrl}?VroomTakeover=1\r\n*** RAWHEADERS ***\r\nHTTP/1.1 500 Internal Server Error\r\nDate: Wed, 29 Apr 2020 12:49:38 GMT\r\nContent-Length: 60\r\nP3P: CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"\r\nServer: Microsoft-IIS/10.0\r\nSPRequestGuid: 92824d9f-b051-2000-3b6c-f29fd7b02bd4\r\nrequest-id: 92824d9f-b051-2000-3b6c-f29fd7b02bd4\r\nMS-CV: n02CklGwACA7bPKf17Ar1A.0\r\nStrict-Transport-Security: max-age=31536000\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nSPRequestDuration: 82\r\nSPIisLatency: 4\r\nX-Powered-By: ASP.NET\r\nMicrosoftSharePointTeamServices: 16.0.0.20015\r\nX-Content-Type-Options: nosniff\r\nX-MS-InvokeApp: 1; RequireReadOnly\r\n\r\n*** RAWBODY:\r\n{\"error\":{\"code\":\"itemNotFound\",\"message\":\"Item not found\"}}\r\n*** END *** 0x80004005 Unspecified error.\r\n[OneDrive.Media.Streams] e:\\source\\repos\\mediaprocessingcomponents2\\streams\\streamonuriimpl.cpp(647) *** HTTP 500 ***\r\n*** RAWURL ***\r\n{someUrl}?VroomTakeover=1\r\n*** RAWHEADERS ***\r\nHTTP/1.1 500 Internal Server Error\r\nDate: Wed, 29 Apr 2020 12:49:38 GMT\r\nContent-Length: 60\r\nP3P: CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"\r\nServer: Microsoft-IIS/10.0\r\nSPRequestGuid: 92824d9f-9056-2000-3b6c-f99db5edd229\r\nrequest-id: 92824d9f-9056-2000-3b6c-f99db5edd229\r\nMS-CV: n02CklaQACA7bPmdte3SKQ.0\r\nStrict-Transport-Security: max-age=31536000\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nSPRequestDuration: 107\r\nSPIisLatency: 0\r\nX-Powered-By: ASP.NET\r\nMicrosoftSharePointTeamServices: 16.0.0.20015\r\nX-Content-Type-Options: nosniff\r\nX-MS-InvokeApp: 1; RequireReadOnly\r\n\r\n*** RAWBODY:\r\n{\"error\":{\"code\":\"itemNotFound\",\"message\":\"Item not found\"}}\r\n*** END *** 0x80004005 Unspecified error.\r\n[OneDrive.Media.Streams] e:\\source\\repos\\mediaprocessingcomponents2\\streams\\streamonuriimpl.cpp(647) *** HTTP 500 ***\r\n*** RAWURL ***\r\n{someUrl}?VroomTakeover=1\r\n*** RAWHEADERS ***\r\nHTTP/1.1 500 Internal Server Error\r\nDate: Wed, 29 Apr 2020 12:49:38 GMT\r\nContent-Length: 60\r\nP3P: CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"\r\nServer: Microsoft-IIS/10.0\r\nSPRequestGuid: 92824d9f-4065-2000-3b6c-faec5e984212\r\nrequest-id: 92824d9f-4065-2000-3b6c-faec5e984212\r\nMS-CV: n02CkmVAACA7bPrsXphCEg.0\r\nStrict-Transport-Security: max-age=31536000\r\nX-FRAME-OPTIONS: SAMEORIGIN\r\nSPRequestDuration: 63\r\nSPIisLatency: 0\r\nX-Powered-By: ASP.NET\r\nMicrosoftSharePointTeamServices: 16.0.0.20015\r\nX-Content-Type-Options: nosniff\r\nX-MS-InvokeApp: 1; RequireReadOnly\r\n\r\n*** RAWBODY:\r\n{\"error\":{\"code\":\"itemNotFound\",\"message\":\"Item not found\"}}\r\n*** END *** 0x80004005 Unspecified error.\r\n[OneDrive.Media.Streams] e:\\source\\repos\\mediaprocessingcomponents2\\streams\\streamonuriimpl.cpp(1695) The stream is in a fatal error state and can no longer be used. 0x80004005 Unspecified error.\r\n[OneDrive.Media.Streams] e:\\source\\repos\\mediaprocessingcomponents2\\streams\\streamonuriimpl.cpp(1563) 0x80004005 Unspecified error.\r\n[OneDrive.Media.Streams] e:\\source\\repos\\mediaprocessingcomponents2\\streams\\streamonuriimpl.cpp(1988) 0x80004005 Unspecified error.",
"innererror": {
"code": "Web_500InternalServerError"
}
}
我已经检查了 Azure 应用程序权限,并为应用程序授予了所有必需的(Files.Read.All、Files.ReadWrite.All、Sites.Read.All、Sites.ReadWrite.All)。解码令牌后查看角色:
"roles": [
"Sites.Read.All",
"Sites.ReadWrite.All",
"Files.ReadWrite.All",
"User.Read.All",
"Files.Read.All"
]
有谁知道我错过了什么?