使用 JavaScript 获取 SharePoint 2013 库中每个视频的 URL

问题描述

我需要使用 JavaScript 获取库中每个视频的 URL(我不知道库中会有多少视频)。我还需要获取有关每个视频的特定信息,例如创建日期。我该怎么做?我正在使用脚本编辑器 Web 部件来执行 JavaScript。

解决方法

您可以使用 rest API 来获取您想要的信息。

/_api/web/lists/GetByTitle('library title')/files

enter image description here

/_api/web/GetFolderByServerRelativeUrl('/sites/dev/Doc')/Files

enter image description here Get to know the SharePoint REST service

,

使用下面的 url 调用 Rest 会给你你想要的东西

   public class Number
    {
        public int intVal { get; set; }
        public string strVal { get; set; }
    }