如何使用RESTAPI从自定义列表中的文件夹中获取列表项?

如何使用RESTAPI从自定义列表中的文件夹中获取列表项?,rest,sharepoint-2013,Rest,Sharepoint 2013,我在Office 365工作。我已经将RESTAPI用于不同类型的操作。我可以很容易地在文档库的文件夹中找到列表项,因为它们是文件。我希望列表项位于自定义列表中的文件夹中。为此,我找不到任何RESTAPI。您能给我提供任何REST API,它可以从自定义列表中的文件夹中检索列表项吗?我得到了答案。以下是方法 var camlQuery = { 'query': { '__metadata': { 'type': 'SP.CamlQuery' }, 'Vie

我在Office 365工作。我已经将RESTAPI用于不同类型的操作。我可以很容易地在文档库的文件夹中找到列表项,因为它们是文件。我希望列表项位于自定义列表中的文件夹中。为此,我找不到任何RESTAPI。您能给我提供任何REST API,它可以从自定义列表中的文件夹中检索列表项吗?

我得到了答案。以下是方法

var camlQuery = {
    'query': {
        '__metadata': { 'type': 'SP.CamlQuery' },
        'ViewXml': '<View><Query/></View>',
        'FolderServerRelativeUrl': '/sites/EdvelopTest3/Lists/QuestionsList/test/test1'
    }
};

var url = OEPContext.appWebUrl + "/_api/SP.AppContextSite(@target)/web/lists/getByTitle('OEPLMSQuestions')/getitems?$select=ID,Title&@target='" + OEPContext.hostWebUrl + "'";
jQuery.ajax({
    async: false,
    url: url,
    type: "POST",
    headers: {
        "accept": "application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val()
    },
    data: JSON.stringify(camlQuery),
    success: function (data) {             
        var result = "success";
    },
    error: function (data, msg) {
        var result = "Fail";
    }
});
var camlQuery={
“查询”:{
“_元数据”:{“类型”:“SP.CamlQuery”},
“ViewXml”:“,
“FolderServerRelativeUrl”:“/sites/edevelopTest3/list/QuestionsList/test/test1”
}
};
var url=OEPContext.appWebUrl+“/_api/SP.AppContextSite(@target)/web/lists/getByTitle('OEPLMSQuestions')/getitems?$select=ID,Title&@target=”+OEPContext.hostWebUrl+“;
jQuery.ajax({
async:false,
url:url,
类型:“POST”,
标题:{
“接受”:“application/json;odata=verbose”,
“内容类型”:“应用程序/json;odata=verbose”,
“X-RequestDigest”:$(“#u-RequestDigest”).val()
},
数据:JSON.stringify(camlQuery),
成功:函数(数据){
var result=“success”;
},
错误:函数(数据、消息){
var result=“失败”;
}
});

我得到了答案。以下是方法

var camlQuery = {
    'query': {
        '__metadata': { 'type': 'SP.CamlQuery' },
        'ViewXml': '<View><Query/></View>',
        'FolderServerRelativeUrl': '/sites/EdvelopTest3/Lists/QuestionsList/test/test1'
    }
};

var url = OEPContext.appWebUrl + "/_api/SP.AppContextSite(@target)/web/lists/getByTitle('OEPLMSQuestions')/getitems?$select=ID,Title&@target='" + OEPContext.hostWebUrl + "'";
jQuery.ajax({
    async: false,
    url: url,
    type: "POST",
    headers: {
        "accept": "application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val()
    },
    data: JSON.stringify(camlQuery),
    success: function (data) {             
        var result = "success";
    },
    error: function (data, msg) {
        var result = "Fail";
    }
});
var camlQuery={
“查询”:{
“_元数据”:{“类型”:“SP.CamlQuery”},
“ViewXml”:“,
“FolderServerRelativeUrl”:“/sites/edevelopTest3/list/QuestionsList/test/test1”
}
};
var url=OEPContext.appWebUrl+“/_api/SP.AppContextSite(@target)/web/lists/getByTitle('OEPLMSQuestions')/getitems?$select=ID,Title&@target=”+OEPContext.hostWebUrl+“;
jQuery.ajax({
async:false,
url:url,
类型:“POST”,
标题:{
“接受”:“application/json;odata=verbose”,
“内容类型”:“应用程序/json;odata=verbose”,
“X-RequestDigest”:$(“#u-RequestDigest”).val()
},
数据:JSON.stringify(camlQuery),
成功:函数(数据){
var result=“success”;
},
错误:函数(数据、消息){
var result=“失败”;
}
});