1

I need to fetch the listitem details using it's url with REST API. The list item url is like :

http://<webappname>/Sites/<sitecollection name>/en-US/Pages/TVM3.aspx

I want to fetch the details of TVM3.aspx using this url, because I don't have any other information to fetch details.

  • This seems to be the URL of the page not the list. Kindly clear the requirement. – Hardik Jun 30 '16 at 12:37
  • Mohor, as the other have stated, the URL you provided is not a list item URL, but a page URL. I can presume that your page may contains a list view webpart, but we actually need the URL of the list or list item to be able to give you a RESTful endpoint. A list item URL usually looks like this: http://<webappname>/Sites/<sitecollection name>/Lists/<list name>/DispForm.aspx?ID=<list item id>. – Mihail-Florin Popa Jun 30 '16 at 12:51
4

To get the ListItem details using REST API, we have to call the below endpoint,

https://webappname/sites/sitecollection_ name/_api/Web/GetFileByServerRelativeUrl('/Sites/sitecollection_name>/en-US/Pages/TVM3.aspx')/ListItemAllFields

GetFileByServerRelativeUrl( <server relative url of a file>)

ListItemAllFields property returns all field values of a file.

1

You can retrieve page properties from a Pages library using REST just like any other list/library. For the above URL you could get that item using the following REST URL:

http://<webappname>/Sites/<sitecollection name>/en-US/_api/web/lists/getbytitle('Pages')/items?$filter=FileRef eq '/sites/<sitecollection name/en-US/Pages/TVM3.aspx'

It would be better to reference by a different property such as ID or Title in the $filter, but the above should work for you.

0
http://<webappname>/Sites/<sitecollection name>/en-US/Pages/TVM3.aspx

Above URL is not any end-point of REST API. End point of a list can be found in the following link.

CRUD Operation to List Using SharePoint 2013 Rest API

You can get the content of TVM3.aspx using $.get and from it you can find your list details

$.get(url,function(data){

});

See more about jQuery.get()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.