office365 - MS Graph API 选择 "fields"查询参数不起作用

标签 office365 microsoft-graph-api sharepoint-online

使用 Graph API 获取列表项,我可以在结果中看到一个字段: https://graph.microsoft.com/v1.0/sites/{siteId}/lists/{listId}/items/{itemId} enter image description here

但是,当我尝试在选择中使用 fields 时,它不会显示: https://graph.microsoft.com/v1.0/sites/{siteId}/lists/{listId}/items/{itemId}?select=id,fields

enter image description here

我的猜测是fields是一个保留字,例如?expand=fields(...)

  • 有人知道支持这一说法的文档吗?
  • 或者知道如何在选择查询参数中使用字段

最佳答案

Someone know of documentation to support this claim?
Or know how to use fields in select query parameter?

对于你的第一个问题,我现在已经找到了文档。 对于你的第二个问题,根据我的测试,你只需要更正你的查询字符串:

https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com/lists/aa8df67a-e7d7-4d33-a57a-20d8e08bf764/items/1?$expand=fields&$select=id,fields

结果如下:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('xxx.sharepoint.com')/lists('aa8df67a-e7d7-4d33-a57a-20d8e08bf764')/items(id,fields)/$entity",
    "@odata.etag": "\"c19fc274-2a75-48e9-bef1-e5cada2f0cd7,1\"",
    "id": "1",
    "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c7a1aea2aba3b487a8a3a6b3a6e9a4a8a9b3a2bfb3" rel="noreferrer noopener nofollow">[email protected]</a>": "https://graph.microsoft.com/v1.0/$metadata#sites('xxx.sharepoint.com')/lists('aa8df67a-e7d7-4d33-a57a-20d8e08bf764')/items('1')/fields/$entity",
    "fields": {
        "@odata.etag": "\"c19fc274-2a75-48e9-bef1-e5cada2f0cd7,1\"",
        "id": "1",
        "ContentType": "Document",
        "Created": "2018-06-04T09:55:06Z"
     }
}

注意:现在不支持多级选择,例如$select=id,fields.title

关于office365 - MS Graph API 选择 "fields"查询参数不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51779656/

相关文章:

c# - 从 Outlook 收件箱读取邮件时,基本身份验证不再有效

api - Office 365 邮件收件箱文件夹 EXPUNGE 使用 java 邮件 API 使用 IMAP 失败

azure - OneDrive REST API : "message": "The specified item does not have content." when downloading a file

php - Azure AD 身份验证问题 - 不记名 token 仅返回应用程序信息

jquery - 如何使用Rest-api获取sharepoint中的访问 token ?

Azure AD 仅适用于 SharePoint,无需授予广泛的租户权限

office365 - 如何在 Office365 中查找特定联系人的 URL

python - 导入错误 : cannot import name 'Account' from 'O365' using Office 365 Project

json - 获取所有应用程序扩展,以及仅从 MS Graph 获取对象的应用程序扩展

azure - SharePoint 框架 AadHttpClient - 操作是实验性功能的一部分