Friday, January 1, 2016

Get Single list items restapi SharePoint


getListItem("http://peakfinders",1,complete, failure);

function getListItem(url, listname, id, complete, failure) {
// Getting our list items
$.ajax({
url: url + "/_api/web/lists/getbytitle('" + listname + "')/items(" + id + ")",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
// Returning the results
complete(data);
},
error: function (data) {
failure(data);
}
});
}
}

No comments:

Post a Comment