Sharepoint 如何使用JS REST API在SP2013上获取基于basetemplate 106的列表?
我只想获得basetemplate 106的列表 我现在掌握的代码是:Sharepoint 如何使用JS REST API在SP2013上获取基于basetemplate 106的列表?,sharepoint,rest,sharepoint-2013,Sharepoint,Rest,Sharepoint 2013,我只想获得basetemplate 106的列表 我现在掌握的代码是: url: appweburl + "/_api/SP.AppContextSite(@target)/web/lists/?@target='" + hostweburl + "'", method: "GET", headers: { "Accept": "application/json; odata=verbose" },
url:
appweburl +
"/_api/SP.AppContextSite(@target)/web/lists/?@target='" + hostweburl + "'",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: onGetHostWebListsSuccess,
error: onGetHostWebListsFail
这段代码将从站点获取所有列表,这是很多信息。但我想缩小范围。用于降低数据流量
我们将非常感谢在这方面提供的任何帮助。谢谢 您可以使用$filter查询选项选择要返回的项目 因此,在您的情况下,过滤器将如下所示:
$filter=BaseTemplate eq 106
appweburl + "/_api/SP.AppContextSite(@target)/web/lists?$filter=BaseTemplate eq 106&@target='" + hostweburl + "'"
您的URL如下所示:
$filter=BaseTemplate eq 106
appweburl + "/_api/SP.AppContextSite(@target)/web/lists?$filter=BaseTemplate eq 106&@target='" + hostweburl + "'"