What is the difference between CSOM, JSOM and REST API?

CSOM JSOM REST API
CSOM(Client Side Object Model) requires Microsoft.SharePoint.Client.Runtime.dll and Microsoft.SharePoint.Client.dll to interact with SharePoint JSOM(JavaScript Object Model) requires two main libraries sp.runtime.js and sp.js to interact with SharePoint REST API(Representational State Transfer) does not require any dll or JS library, as it is based on OData protocol, we can use REST API directly to interact with SharePoint
CSOM calls are Synchronous JSOM calls are Asynchronous REST API calls can be either Synchronous OR Asynchronous
When to use: 1)      Provide Hosted App (Add-in) 2)      .Net application that performs CRUD operation on SharePoint data 3)      Batch Processing 4)      conditional processing of code and exception handling 5)      Working with LINQ When to use: 1)      SharePoint Hosted App(Add-in) 2)      Html/JavaScript application that interacts with SharePoint 3)      Batch Processing When to use: 1)      SharePoint Hosted App(Add-in) 2)      A mobile app/any external system that interacts with SharePoint content
© 2019 Code SharePoint