Created
October 14, 2016 09:01
-
-
Save davehax/0e3f2cff3ab041388d6775e41eda1709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var camlQuery = '<View Scope="RecursiveAll"><RowLimit>3</RowLimit><Query><Where><Eq><FieldRef Name="FSObjType" /><Value Type="Integer">0</Value></Eq></Where></Query></View>' | |
return $.ajax({ | |
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/Lists/GetByTitle('Documents')/GetItems?$select=ID,Title,EncodedAbsUrl,File/Name&$expand=File", | |
type: "POST", | |
contentType: "application/json; odata=verbose", | |
headers: { | |
"X-RequestDigest": $("#__REQUESTDIGEST").val(), | |
"Accept": "application/json; odata=verbose" | |
}, | |
data: JSON.stringify({ | |
query: { | |
__metadata: { | |
type: "SP.CamlQuery" | |
}, | |
ViewXml: camlQuery, | |
FolderServerRelativeUrl: '/some/folder/in/there' | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment