Web Service Vs API 1713791425
Web Service Vs API 1713791425
VS
WEB SE RVICE
Learn Like I am 10
Hi, I am Smriti Sharan. I am avid
blogger and youtuber.
I break down complex topics with fun relatable real time examples so
learning is fun wow !!
By Smriti Sharan
Can learning be more fun ?
Cloudy: There has been a lot of confusion around APIs and web services.
Can you clear up the concepts?
By Smriti Sharan
Cloudy: What exactly is a web service then?
Simmy: The difference between a web service and an API is very subtle
and they are often used interchangeably.
Simply put, a web service is a service or resource that’s made available over the
internet. Remember this: all web services are APIs, but not all APIs are web services.
To remember this, think of it like this: all tigers are cats, but not all cats are tigers.
By Smriti Sharan
Cloudy: I'm still a bit confused!
Some of these tools can be used on their own, like a screwdriver to tighten
a screw, or using a wrench to hold a bolt .
By Smriti Sharan
Simmy: A web service is like a specific tool that’s designed to be used over the
Internet. Think of it like a cellphone charger.
It’s a tool that only works when it's plugged into a power source. Just as the
charger uses electricity to power up your phone, web services use the internet to
enable different software systems to interact and share data.
By Smriti Sharan
Cloudy: So, web services require a network because they operate over the
Internet?
Simmy: Exactly! While APIs can be online or offline, web services
must use a network.
By Smriti Sharan
For instance, you directly use system.debug to debug your code instead of
worrying about the underlying system class. It is a practical use of an API.
The same goes for exception classes.
Another example is the Wire Service in LWC. We simply put an import
statement to use wire in LWC to utilize its functionality, but behind the
scenes, there is an API that facilitates this ease of use.
Cloudy: How does a web service fit into this scenario?
Simmy: For web services, imagine you want to set up a meeting in Zoom
directly from Salesforce. You’d use Zoom’s web service to facilitate
communication between Salesforce and Zoom’s systems over the Internet.
Cloudy: It sounds complicated!
Simmy: It might seem complicated at first, but just remember, when an API is used
over the web, it becomes a web service. APIs are a broader concept that includes
web services but isn't limited to them.
Simmy: For example, you can use Google Translator over the web to convert Hindi
text into English. Essentially, you are using Google Translator’s web service to
translate your text into another language over the Internet.
By Smriti Sharan
Cloudy: What is the need for an API?
Simmy: Imagine you're in Germany, where Dhruv Rathee lives, and you only
speak English and Hindi while locals speak German. If you want to ask for
‘Dhruv Rathee's address’, you would need a translator so you both can
communicate. Similarly, without APIs, how would different systems built in
different ways communicate? That's where APIs come into the picture.
By Smriti Sharan
Cloudy: That was a fun example! What are the types of web services?
Simmy: The SOAP API and REST API are considered both web services and APIs since
they define a set of features accessible over the web.
SOAP is like ordering a preset meal at McDonald REST, which is more like a buffet where you can
choose what you want—it's flexible and uses
You get what's defined and it’s very structured. web standards. Here, you have the freedom to
It uses a specific protocol, like a strict recipe choose exactly what you want.
It is a brief overview of SOAP and REST . We will discuss in Detail in upcoming part
By Smriti Sharan
Wow! I hope this clarifies the differences between web services and APIs
for everyone!
If you Liked the document and it clears your concepts, feel free to comment to
provide any feedback.
By Smriti Sharan
By Smriti Sharan