OData in SharePoint 2013 – Lists and Items


I will explain below the most common GET operations which most of developer may need them while query SharePoint 2013 lists and list items using REST.

  • Get all lists in web

  • Get all list by title

  • Get all items in specific list
    • Request: http://<server>/_api /web1/web2/lists/GetByTitle(‘myList’)/items
    • Result: the below screen shows one item Meta Data in the response

  • Get list item by item ID
    • Request: http://<server>/_api /web1/web2/lists/GetByTitle(‘myList’)/items/GetItemById(4)
    • Result:

  • Return items with specific fields
    • Request: http://<server>/_api /web1/web2/lists/GetByTitle(‘myList’)/items?$select=Title,Age
    • Result:

  • Order items in the query

 

For more information:

Advertisements

2 thoughts on “OData in SharePoint 2013 – Lists and Items

  1. Pingback: How to Read from SharePoint 2013 List in 6 Ways « Mostafa Absy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s