listItem 资源listItem resource

表示 SharePoint [列表][] 中的项目。Represents an item in a sharepoint list. 该列表中的列值可通过 fieldValueSet 字典获得。Column values in the list are available through the fieldValueSet dictionary.

方法Methods

下列方法可用于 listItem 资源。The following methods are available for listItem resources. 所有示例都与 list 相关:https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}All examples are relative to a list: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}.

方法Method 返回类型Return Type 说明Description
[获取][]Get listItemlistItem 获取列表中的项。Get an item in a list.
获取列值Get column values listItemlistItem 从 listItem 获取列的值。Get column values from listItem.
获取分析结果Get analytics itemAnalyticsitemAnalytics 对此资源可获取分析。Get analytics for this resource.
按间隔获取活动Get activities by interval itemActivityStatitemActivityStat 在指定的时间间隔内获取 itemActivityStats 的集合。Get a collection of itemActivityStats within the specified time interval.
CreateCreate listItemlistItem 在列表中创建新的 listItem。Create a new listItem in a list.
删除Delete 无内容No Content 从 list 中删除项。Removes an item from a list.
UpdateUpdate fieldValueSetfieldValueSet 更新 listItem 上的属性。Update the properties on a listItem.
更新列值Update column values fieldValueSetfieldValueSet 更新 listItem 上的列值。Update column values on a listItem.

属性Properties

listItem 资源具有以下属性。The listItem resource has the following properties.

属性名称Property name 类型Type 说明Description
contentTypecontentType contentTypeInfocontentTypeInfo 此列表项的内容类型The content type of this list item

以下属性继承自 ** baseItem**。The following properties are inherited from baseItem.

属性名称Property name 类型Type 说明Description
idid stringstring 项的唯一标识符。只读。The unique identifier of the item. Read-only.
namename stringstring 项目名称/标题。The name / title of the item.
createdBycreatedBy identitySetidentitySet 此项的创建者的标识。Identity of the creator of this item. 只读。Read-only.
createdDateTimecreatedDateTime DateTimeOffsetDateTimeOffset 创建项目的日期和时间。只读。The date and time the item was created. Read-only.
说明description stringstring 项目的描述性文本。The descriptive text for the item.
eTageTag 字符串string 该项目的 ETag。只读。ETag for the item. Read-only.
lastModifiedBylastModifiedBy identitySetidentitySet 此项的最后一个修饰符的标识。Identity of the last modifier of this item. 只读。Read-only.
lastModifiedDateTimelastModifiedDateTime DateTimeOffsetDateTimeOffset 上次修改项目的日期和时间。只读。The date and time the item was last modified. Read-only.
parentReferenceparentReference itemReferenceitemReference 父信息(如果此项具有父级)。读写。Parent information, if the item has a parent. Read-write.
sharepointIdssharepointIds sharepointIdssharepointIds 返回对 SharePoint REST 兼容性有用的标识符。只读。Returns identifiers useful for SharePoint REST compatibility. Read-only.
webUrlwebUrl string (url)string (url) 在浏览器中显示此项目的 URL。只读。URL that displays the item in the browser. Read-only.

关系Relationships

listItem 资源与其他资源具有以下关系。The listItem resource has the following relationships to other resources.

关系名称Relationship name 类型Type 说明Description
activitiesactivities itemActivity 集合itemActivity collection 最近发生在此项上的活动的列表。The list of recent activities that took place on this item.
分析analytics itemAnalytics 资源itemAnalytics resource 此项目上发生的查看活动的相关分析。Analytics about the view activities that took place on this item.
driveItemdriveItem driveItemdriveItem 对于文档库,driveItem 关系将 listItem 显示为 driveItemFor document libraries, the driveItem relationship exposes the listItem as a driveItem
fieldsfields fieldValueSetfieldValueSet 在此列表项上设置的列的值。The values of the columns set on this list item.
版本versions listItemVersion 集合listItemVersion collection 先前版本的列表项的列表。The list of previous versions of the list item.

JSON 表示形式JSON representation

下面是 listItem 资源的 JSON 表示形式。Here is a JSON representation of a listItem resource.

{
  "contentType": { "@odata.type": "microsoft.graph.contentTypeInfo" },
  "fields": { "@odata.type": "microsoft.graph.fieldValueSet" },
  "sharepointIds": { "@odata.type": "microsoft.graph.sharepointIds" },

  /* relationships */
  "activities": [{"@odata.type": "microsoft.graph.itemActivity"}],
  "analytics": { "@odata.type": "microsoft.graph.itemAnalytics" },
  "driveItem": { "@odata.type": "microsoft.graph.driveItem" },
  "versions": [{"@odata.type": "microsoft.graph.listItemVersion"}],

  /* inherited from baseItem */
  "id": "string",
  "name": "name of resource",
  "createdBy": { "@odata.type": "microsoft.graph.identitySet" },
  "createdDateTime": "timestamp",
  "description": "description of resource",
  "eTag": "string",
  "lastModifiedBy": { "@odata.type": "microsoft.graph.identitySet" },
  "lastModifiedDateTime": "timestamp",
  "parentReference": { "@odata.type": "microsoft.graph.itemReference"},
  "webUrl": "url"
}