Web services
Programmable interface to services at remote site.
(i.e. Can be called by programs with no human user.)
Called "Web services"
or the use of
"Web APIs".
Example:
Your app posts updates to Twitter
without leaving the app.
Needs read-write access over network.
Through API interface - calling methods on remote site.
Needs authentication.
Example:
Manufacturer automatically queries distributors for stock levels and other shared information.
Done over network,
but general public has no access to this information.
The name "Web" implies uses HTTP.
But some services in fact do not.
- APIs in general
- programmableweb.com
- Service-oriented architecture (SOA)
is the general design principle.
- The service may be:
- Public or private.
- Paid or free.
- Authenticate or not.
Even free service can need authenticate. e.g. Your own YouTube account.
- Between company and partner company only.
e.g. Stock tracking service to/from supplier and customer.
- Between two divisions inside a company.
A big feature of SOA thinking is to make one department's work usable by another department.
Service description
Popular APIs
2010 survey of web APIs.
Shows REST overtaking SOAP.
From
programmableweb.com.
2017 survey of APIs
shows REST dominant, SOAP still in use.
2019 graph
showing growth in number of different web APIs.
REST v SOAP
- REST
- Allows any data format.
-
It often uses JSON
for fast parsing on client side.
But this is not required.
Other formats can be used.
-
Simple to code and deploy.
Easy for large numbers of developers to use.
-
Can use
https
for security.
- Widely used for "open APIs" with large number of developers.
- SOAP
- Uses
XML.
-
Apart from being restricted to one format,
XML often involves more overhead -
more bytes of data, more parsing time.
- Higher learning curve for developers.
-
SOAP has more advanced
WS-Security
for mission-critical security.
-
Widely used in business.
Note some APIs are business-to-business (or department-to-department within one company)
and not known to public.
Future of APIs