【发布时间】:2017-12-01 20:24:03
【问题描述】:
我正在尝试使用 [beta] Microsoft Graph endpoint 在 SharePoint Online 中创建一个新的 list item。目标是从 Outlook 加载项调用 Microsoft Graph,但 Postman 仍然存在问题。
当我按照文档调用端点时,我收到以下错误消息:
{
"error": {
"code": "unauthenticated",
"message": "The caller is not authenticated.",
"innerError": {
"request-id": "bb094f39-71c9-4c7d-9d9b-913cc9622baf",
"date": "2017-08-08T11:32:02"
}
}
}
我正在使用 ADAL JS 获取身份验证令牌,并使用我的 tenantID 初始化了我的 AuthenticationContext。我的应用拥有以下权限:offline_access, Sites.Read.All, Sites.ReadWrite.All, User.Read
第二次编辑 - 有关 readItem 的更多详细信息
我将https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items 端点与来自/sites 的所需站点的{site-id} 和来自/sites/{site-id}/lists 的列表的{list-id} 一起使用,但这是我得到的空响应:
{
"@odata.context": "https://graph.microsoft.com/...",
"value": []
}
如果我尝试将 /{item-id} 添加到我的原始呼叫以访问特定项目,我会收到以下回复:
{
"error": {
"code": "itemNotFound",
"message": "The specified list was not found",
"innerError": {
"request-id": "6e7ccae3-3aee-4dbb-ae3e-de61250478e0",
"date": "2017-08-09T13:13:33"
}
}
}
这没有意义,因为如果我在没有/items/.. 的情况下拨打电话,我可以检索有关列表的有效信息
感谢任何和所有输入 :) 我很乐意提供更多代码,这是我认为相关的所有内容,并且不想过度拥挤帖子。
【问题讨论】: