Friday, 25 December 2015

REST End point URLs - SharePoint 2013

Today I will be sharing the Service End point URLs for the SharePoint 2013. To access SharePoint resources using REST, construct a RESTful HTTP request, using the Open Data Protocol (OData) standard, which corresponds to the desired client object model.

Example :

List Name - Products

Columns - Title , Company , Products , Manager

In which Title , Company are Single Line of Text columns.
Company is a lookup column ( LookUp list - Company Names  and It is Looking up to the column Company name with Internal Name Title ) .
Manager is a people Picker Column.

Service call for accesssing the columns would be -

(Always use Internal names for the columns and Display names for the List)
https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager

For Lookup and People picker colums we have to expand the column like above

For applying the filter on the above query -

https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager&$filter=Products eq 'Product 1'

https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager&$filter=Company/Title eq 'Company 1'

For applying multiple filters :

https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager&$filter=((Products eq 'Product 1') and(Company/Title eq 'Company 1'))

From the next post onwards I will be providing the codes for CRUD operation on Sharepoint 2013 list using Rest api.

Happy Coding...

No comments:

Post a Comment