Sharepoint - Get documents By ID from document library using Rest API
Finally i found solution, i got full file url through EncodedAbsUrl
My Document id is 6 and got full filepath from its id
var requestUri = _spPageContextInfo.webAbsoluteUrl +
"/_api/web/lists/getByTitle('My Documents')/items?$select=EncodedAbsUrl&$filter=Id eq 6";
var requestHeaders = {
"accept": "application/json;odata=verbose"
}
$.ajax({
url: requestUri,
type: 'GET',
dataType: 'json',
headers: requestHeaders,
success: function (data)
{
$.each(data.d.results, function(i,result) {
var path = result.EncodedAbsUrl;
});
},
error: function ajaxError(response) {
alert(response.status + ' ' + response.statusText);
}
});