21

Can any one explain me what is REST API and SOAP API. Also the example scenarios where these can be used ?

24

SOAP API and REST API are two commonly used API's to expose your data from force.com platform to other platforms(JAVA ,.NET ,etc) or to allow external application to invoke Apex methods.

http://blogs.developerforce.com/tech-pubs/2011/10/salesforce-apis-what-they-are-when-to-use-them.html

This is an interesting blog and may answer your question very well.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_intro.htm

API described in Salesforce documentation above.

SOAP API

1)Supports data in the form of XML only 2)Requires WSDL for the integration 3)Use SOAP API in any language that supports Web services. 4)It is a standard protocol and needs more bandwidth and resources.

REST API 1)Supports both XML and JSON format 2)Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster 3)It is more of an architectural system and requires less bandwidth and resources.

You can also use Apex SOAP and REST Web services to expose data from platform or allow an external application to invoke Apex methods.

You may want to refer to the Apex guide to learn more about this.

| improve this answer | |
  • I am researching on the same topic. Looking at this video - youtube.com/watch?v=dYT3XR8pRgw, I understand that SOAP should be used when the requests are made programmatically (server side). Should REST be used only in cases where the request are from either browser or mobile devices? Our requirement is to load data from salesforce tables into our application. It would be nice to have your thoughts on this. – Andy Dufresne Apr 2 '13 at 7:15
  • REST can be used to load data too.Like if you are extracting data from SFDC and if there are huge data then i would suggest you too use bulk API .salesforce.com/us/developer/docs/api_asynch Bulk API in sfdc is based on REST principles. – Mohith Shrivastava Apr 2 '13 at 7:26
9

Another thing I would add to Mohith's response is that since both REST and OAuth rely strongly on HTTP/S standards - it makes it very easy to find existing libraries to communicate with the API's for nearly any language. Even with there is no "Force.com toolkit", many languages know how to at least speak HTTP, if not REST/OAUTH/JSON.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.