Tuesday, June 04, 2013

SharePoint 2013 REST Service Integration versus Client Object Model

 
Hi Folks,
Microsoft has released REST service in SharePoint 2013. As a SharePoint solution architect/developer you will be having more than one option to manipulate SharePoint data in your client applications.
 
With the REST interface in SharePoint 2013, folks are asking about what are the differences? And what are the benefits over each other? I will list all my insights in points in this blog post.
 
1) One of the main differences between Client Object Model API (COM) than REST API that it requires SharePoint Client assemblies that's only available for .NET technologies. While using the REST API doesn't require any .NET assemblies to be referenced in your client application but use any programming language to execute standard HTTP requests. For example: use the REST API to access SharePoint 2013 from your PHP website or iPhone/Android App.
 
2) What if I want to consume SharePoint 2013 data with Mobile Applications?
If you are planning to consume SharePoint 2013 data through using iOS or Android devices, then the REST API is the way to go. While if you are developing SharePoint 2013 solution on a windows phone 8 then still you have 2 options either REST or Client Object Model while I recommend to go with the REST for portability and code-reuse purposes specially if you plan to have different version of your application in iOS & Android platforms.
3) Benefits of using REST over COM in Mobile apps? The size of your application will be smaller when you use REST since you don’t need to add any assemblies in your App.
4) What about Windows 8 Apps? If you are developing HTML5 & JavaScript Windows 8 App this requires using the REST API in SharePoint 2013.
5) How do you Access SharePoint 2013 REST API?
The REST API is a WCF services hosted on the SharePoint Application server and has HTTP endpoint; you can access it through the following URL:
If you want to access a site collection:  http://MySite/site/_api/
If you want to access a web site:  http://MySite/site/_api/web/
To do the basic CRUD operations, check out this article:
 
“Get started with the SharePoint 2013 REST service”
“Using the SharePoint 2013 REST service”
6) When you read the above MSDN articles, the sample requires you to get an access token to access SharePoint 2013 REST API, Is there an alternative?
The answer is yes, you can access the REST API without getting an access token by using the Cross-Domain JavaScript Library. Here is your complete reference to code this.
7) The REST API is not just available for Site Collections and Site scope CRUD operations but it is also available on BCS, Search, and Social Features in SharePoint 2013. Check out these urls:
a) Using BCS REST service:
            b) Using Search REST service:
c) Using Social Features REST service:
As a solution Architect and Web guy, I’m so excited with the SharePoint 2013 REST API. It is a great shift to the web standards and to eliminate the boundaries to integrate SharePoint with Non-Microsoft platforms and tools.
I see this API will be primarily and heavily used by Mobile Developers and System integrators toward SharePoint Hybrid Solutions.
Hope this helps.
 
 
 

No comments: