9

SharePoint 获取列表的元数据信息(Metadata)

 2 years ago
source link: https://www.cnblogs.com/jianyus/p/15750577.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

SharePoint 获取列表的元数据信息(Metadata)

  前言

  我们在使用REST API的时候,经常需要列表项目的元数据信息,那么,我们该如何获取呢?

  正文

  SharePoint REST API就有一个好用的方法,可以快速获取列表的元数据信息,下面让我们看看!

https://SiteUrl/_api/web/lists/GetByTitle('ListName')?$select=ListItemEntityTypeFullName

  请求返回的XML信息,里面的d:ListItemEntityTypeFullName节点就是我们需要的列表元数据信息:

<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://SiteUrl/_api/"
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
    xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
    xmlns:georss="http://www.georss.org/georss"
    xmlns:gml="http://www.opengis.net/gml" m:etag=""36"">
    <id>https://SiteUrl/_api/Web/Lists(guid'f34bb9c0-61e8-4764-0d6a-677a7a5520a8')</id>
    <category term="SP.List" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="Web/Lists(guid'f34bb9c0-61e8-4764-0d6a-677a7a5520a8')" />
    <title />
    <updated>2021-11-17T06:42:45Z</updated>
    <author>
        <name />
    </author>
    <content type="application/xml">
        <m:properties>
            <d:ListItemEntityTypeFullName>SP.Data.ListNameListItem</d:ListItemEntityTypeFullName>
        </m:properties>
    </content>
</entry>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK