Last active
August 29, 2015 14:09
-
-
Save vgrem/a7f0d08867d0b09e5fc8 to your computer and use it in GitHub Desktop.
Getting SP.List properties using SharePoint REST
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
function getJson(url) | |
{ | |
return $.ajax({ | |
url: url, | |
type: "GET", | |
contentType: "application/json;odata=verbose", | |
headers: { | |
"Accept": "application/json;odata=verbose" | |
} | |
}); | |
} | |
function getListProperties(listTitle) { | |
var listEndpointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/SchemaXml"; | |
return getJson(listEndpointUrl).then( | |
function(data){ | |
var schemaXml = data.d.SchemaXml; | |
return schemaXml2Json(schemaXml); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment