5

I am new to SharePoint, and confused about all of these terminologies, what are the differences between these 3? when do we use each one?

4

Both CSOM and REST are based on the same web service Client.svc in SharePoint 2013.

CSOM

The following list provides guidance on when to use CSOM endpoints:

  • Create a .NET application that performs CRUD operations on SharePoint data
  • Create an HTML/JavaScript application that performs CRUD operations on SharePoint data
  • Create an app for Office that works with SharePoint
  • Create an ASP.NET web application that performs CRUD operations on SharePoint data or external data that is surfaced in SharePoint by a BCS external content type

REST/OData endpoints

OData defines an abstract data model and a protocol that let any client access information exposed by SharePoint. The OData protocol is based on REST which define how HTTP verbs are used.

SharePoint REST service architecture enter image description here

The following list provides guidance on when to use REST/OData endpoints:

  • Create an iOS or Android app that performs CRUD operations on SharePoint data
  • Create a LAMP web application that performs CRUD operations on SharePoint data or external data that is surfaced in SharePoint by a BCS external content type

References

1

You will find many references for the basic definitions of REST and OData. This link provides a good overview.

Now in a SharePoint Context:

SharePoint has a service exposed called client.svc which is the endpoint for all client related operations.

The SharePoint 2013 REST API (_api) is a REST API which has operations exposed which can read and modify SharePoint data. You can call this like any other REST API e.g. through the jQuery.ajax function.

The Client Object Model is also a wrapper which internally calls client.svc. The difference here is that it provides a set of typed classes to work with.

  • 1
    Adding to the above to answer "when do we use each one"? You would use these when you had a need to integrate an external system/process with SharePoint. The toolsets you are using to develop the integrations would help drive which option you would choose. For example, if I am writing a desktop application in C#, I would choose the 'Client Object Model' as it provides strongly typed objects for my SharePoint site. If I was using a non-C# platform that could consume RESTful web services, I would use the REST API. If my platform supported OData feeds, I would use the OData services. – tyshock Feb 3 '14 at 21:03
  • So does the REST API call client.svc? Where's the use of OData here? – SharePoint Freak Feb 4 '14 at 20:24

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.