function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Developer BaseDeveloper Base 

What is REST API used for?

Hello,

is REST API used ONLY for external applications to connect to Salesforce database? Or are there any other use cases?

Do we use REST API for example when connecting to external apps to gather data, or do we rather use something else like Salesforce Connect?
ANUTEJANUTEJ (Salesforce Developers) 
Hi there,

Salesforce provides a native REST Api that enables external apps to read / manipulate the data located in Salesforce.

Generally it is used to manipulate data or fetch data from salesforce one example is mentioned in the below link:

https://medium.com/@salesforce.notes/salesforce-rest-api-tutorial-3bcd39e493f6

The Salesforce REST API is best suited for browser or mobile apps which don’t need access to high amounts of records. In case you want to access high amounts of records you should probably explore Salesforce BULK API. Salesforce REST API supports JSON and XML.

In a nutshell, REST and SOAP are protocols that are used to build other API's as well.

To see which API is based on which protocol you can check the table in the below link:

>> https://help.salesforce.com/articleView?id=sf.integrate_what_is_api.htm&type=5

Additionally, I would suggest you to check the below link that states the differences between rest and soap API.

>> https://www.soapui.org/learn/api/soap-vs-rest-api/

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Malika Pathak 9Malika Pathak 9
Hi Developer Base,

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
  • Supports data in the form of XML only
  • Requires WSDL for the integration
  • Use SOAP API in any language that supports Web services.
  • It is a standard protocol and needs more bandwidth and resources.
REST API
  • Supports both XML and JSON format
  • Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster
  • 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 Trailhead (https://trailhead.salesforce.com/en/content/learn/v/modules/api_basics/api_basics_overview#:~:text=Synchronous-,When%20to%20Use%20REST%20API,mobile%20applications%20and%20web%20projects.)to learn more about this.


Let me know if this information helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you