[SalesForce] the difference in HTTP callout and SOAP & REST api

Hello I was preparing for certification and was confused about the difference in HTTP callout and REST &SOAP api. Can anyone please explain what the key differences in these.

Thank you in advance.

Best Answer

An HTTP callout is code that you write within Salesforce to (generally) call out to an external API over HTTP.

REST and SOAP are types of APIs.

So, you could make a callout to an external SOAP API or a REST API. Think of doing a callout as wanting to communicate with someone, the protocol (REST or SOAP) is the format of the communication, and HTTP is the method of communicating. If you mix them up it doesn't work, like trying to send a fax to someone's cell phone number. In that example, the phone line is the method (HTTP), the fax is the protocol(SOAP or REST) and making the call is the callout.

Salesforce also has it's own SOAP and REST APIs, but those would generally be used by code ran outside of Salesforce to create/read/update/delete Salesforce data.

Related Topic