使用Graph API获取列表项,我可以在结果中看到fields
:
https://graph.microsoft.com/v1.0/sites/{siteId}/lists/{listId}/items/{itemId}
但是,当我尝试在选择中使用fields
时,它不会显示:
https://graph.microsoft.com/v1.0/sites/{siteId}/lists/{listId}/items/{itemId}?select=id,fields
我的猜测是fields
是保留字,例如?expand=fields(...)
fields
?答案 0 :(得分:0)
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",
"fields@odata.context": "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