How can I get CreatedBy
field using REST API SharePoint? Below is the code
var Ownurl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Listname')/items?$select=Author,ID&$filter=ID eq 1;
$.ajax({
url: Ownurl,
headers: { Accept: "application/json;odata=verbose" },
async:false,
success: function (data) {
var items = data.d.results;
if (items[0].Author!= "") {
author = items[0].Author;
}
},eror: function (data) {
alert("An error occurred. Please try again.");
}
});
But somehow I am not able to get Author
.
Is there anything wrong?
Any help would be appreciated
Thanks.