Am quite new to REST API. Our is a SharePoint 2016 on premises environment. We have document library. This document library has a property of type 'Choice'. We added a document and set the value for choice column. Now we have to access the choice property value through REST API. We tried using below URL request in browser. It gives xml response and has Choice column value in it as;
<d:PropertyName>HR Dept</d:PropertyName>
http://websiteurl/_api/web/getFileByServerRelativeUrl('/root/test%20doc%20for%20PDF.pdf')/ListItemAllFields
Thus tried accessing the data through jquery
$.ajax(
{
url:"http://websitename/_api/web/getFileByServerRelativeUrl('/root/test%20doc%20for%20PDF.pdf')/ListItemAllFields",
method:"GET",
headers: {"Accept":"application/json; odata=verbose"},
success: function(data){
debugger;
}
}
);
However not able to get required object details in the json response!
Kindly let know what we are missing / doing wrong.
Thank you