如何访问Sharepoint库中的自定义列-图形API [英] How to access custom columns in a sharepoint library - graph API

查看:76
本文介绍了如何访问Sharepoint库中的自定义列-图形API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用自定义列在文档库的根目录中列出子级.当我使用MS图形REST API进行以下调用时,不会为子项返回任何自定义列数据.

I am listing the children in the root of a document library with custom columns. When I make the following call with the MS graph REST API, no custom column data is returned for the child items.

https://graph.microsoft.com/beta/sites/<site-id>/drive/root/children

我尝试使用?expand=...失败. v1或beta端点有可能吗?

I have tried using ?expand=... without success. Is this possible with either the v1 or beta endpoints?

推荐答案

端点GET https://graph.microsoft.com/beta/sites/<site-id>/drive/root/children返回文件元数据的集合(

Endpoint GET https://graph.microsoft.com/beta/sites/<site-id>/drive/root/children returns the collection of files metadata (DriveItem resource) in the root of the drive.

可以通过 DriveItem.listItem属性,包括在此列表项上设置的列的值(通过

The associated document library list items could be retrieved via DriveItem.listItem property including the values of the columns set on this list item (via ListItem.fields property) like this:

https://graph.microsoft.com/v1.0/sites/root/drive/root/children?$expand=listItem($expand=fields) 

或者,也可以检索SharePoint库列表项和列值(包括自定义项):

Alternatively, SharePoint Library list items and column values (including custom ones) could be retrieved instead:

GET https://graph.microsoft.com/v1.0/sites/root/drive/list/items?$expand=fields

或列出项目以及文件元数据:

or list items along with files metadata:

GET https://graph.microsoft.com/v1.0/sites/root/drive/list/items?$expand=fields,driveItem

这篇关于如何访问Sharepoint库中的自定义列-图形API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆