SharePoint 2013 and Search with REST API and ODATA
One of the biggest change in SharePoint 2013 the search service is extended with REST capabilities. This means, it now supports direct access from REST-based clients – includes client-side applications, non .NET applications apart from .NET-applications. It also has a new shorthand notation for accessing the REST API where CSOM URLs can be accessed through the _api folder. This means that now you don’t access them with _vti_bin in the URL and you can directly use _api as shown below
http://sharepoint/_vti_bin/client.svc/web but http://sharepoint/_api/web
SharePoint 2013 REST API follows the Open Data Protocol specification but also extends it in some ways to support more complex SharePoint specific operations. The SharePoint 2013 REST service responses are formatted by using the Atom protocol by default. But it is also possible to use with HTTP Protocol by using HTTP Accept headers. With HTTP, you can specify that the response is required in JSON format and this can be used in Javascript/jQuery code.
Since a number of REST calls are simple GET operations it is possible to learn the syntax by creating the URL in a browser and looking at the ATOM response being returned. Next are some of examples to get you started:
- https://[yoursharepointsite]/_api/web/
– access a specific site and retrieves different properties - https://[yoursharepointsite]/_api/web/?$select=Title,Id
– only retrieves the Title and ID for a specific site - https://[yoursharepointsite]/_api/lists
- retrieves all lists on a specific site - https://[yoursharepointsite]/_api/lists/getByTitle(‘Consultants’)
– retrieves a single list based on the title used - https://[yoursharepointsite]/_api/lists/getByTitle(‘Consultants’)/Items
– retrieves all items in the list with all the fields returned - https://[yoursharepointsite]/_api/lists/getByTitle(‘Consultants’)/Items/?$select=Title,LastName
– retrieves for all items in the list only the Title and LastName field - https://[yoursharepointsite]/_api/web/lists/getByTitle(‘Consultants’)/Items/?$select=Title,FirstName&$filter=startswith(Title,’C')
– retrieves items in the list where the Title starts with a C and retrieves the Title and LastName field
In the next post, will explore the extensions in the REST API for SharePoint Server 2013.
More information on REST Services, you can refer to:
- Get started with SharePoint 2013 REST service from Microsoft
Krunal Patel
I am SharePoint Senior Developer and currently working on SharePoint-15 Beta. I started programming on 8085 assembly language and then moved to MS technology. I have also worked as android developer as my hobby.
Related posts:
- Search Engine Changes in SharePoint 2013 In this article, I have tried to capture the major...
- Change Sitecollection URL in SharePoint Recently I got request from one of my client to...
- Enable Napa App for Office Online Development with SharePoint SharePoint 2013 and Office Online Preview have been around since...
- Complete guide to installing SharePoint 15 We have had 3 articles to prepare ourselves for installation...
- Install Windows Server 2012 for SharePoint 15 If you are one of SharePoint lovers and really enthusiastic...
Start Contributing!
If you have the knack of writing to share your knowledge with other spirited minds, you can register yourself and get started...
For more information, please visit our Contribute page
Register / Sign In
Information classified
- Announcements (1)
- Code (17)
- .NET (13)
- CSS and HTML (1)
- Database (1)
- Java (1)
- Javascript (1)
- Open Source (6)
- Web Services (1)
- Design (1)
- How-to (18)
- Office 365 (1)
- Server (4)
- SharePoint (8)
- TDD (4)
- Windows 8 (3)
- Presentations (1)
- Promotions (6)
- Uncategorized (1)
Latest on the Stack
- Complete guide to dynamic keyword in C#
- Sharing code: Adding NavigationService
- Mock driven development using .NET
- XecMe – Windows Service Host
- How to Write Access 2013 Custom Web App on Office 365
- Portable Class Library – Articles and Sample References
- Extension SDKs in Build Server without installing it!
- SharePoint 2013 and Search with REST API and ODATA
- Search Engine Changes in SharePoint 2013
- Consuming Odata Service in Windows Store Apps (Include MVVM Pattern)
Twitter Updates
- Sharing code: Adding #NavigationService is.gd/0DDj9G #SharingCode #WindowsPhoneapp #WindowsStoreApps 1 hour ago
- Complete guide to dynamic keyword in C# is.gd/Emmaju #net #development 1 hour ago
- Mock driven development using .NET is.gd/GeHGLe 5 hours ago
- XecMe - Windows Service Host is.gd/0fjCQb #windowsservices #xecme 9 hours ago
- Sharing code: Adding #NavigationService is.gd/0DDj9G #SharingCode #WindowsPhoneapp #WindowsStoreApps 13 hours ago
Coming Soon











