What is a Web Service
A web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (API). Other systems interact with the Web service in a manner prescribed by its description the method exposed in the API definition.
The difference between User Interaction with an application and machine -to-machine communication with a web service is important and leads to different requirements.
What is an API?
An application-programming interface (API) is a set of programming instructions and standards for accessing a Web-based software application. A company releases its API so that other software developers can design products that are powered by its service.
It provides all the building blocks for developing a program. An web based application programming interface is usually language independent. They can be called from several programming languages. APIs run silently in the background. They are completely invisible to software users and web surfers. Their primary role is to provide a channel for applications to work with each other to make sure the user gets the required functionality and information.
In the context of Worldbox: Using the API external applications can access the company informations or get reports delivered. Thus external customers can create their own applications that access the data and information of Worldbox offered thanks to the API. Thats also called Software-As-A-Service (SaaS).
What is Worldbox trying to achieve with the Web Service?
- External customers are able to use the Worldbox Core Application in order to build there own application around the functionality provided by the webservice API.
- It’s the base for mobile apps.
What means REST?
REST is not a technology it’s rather an architectural style of exposing API to the web service consumers. The REST architectural style was developed by W3C Technical Architecture Group in parallel with HTTP. The Wide Web with its URL system represents the largest implementation of a system conforming to the REST architectural style.
The REST architectural style is used by almost all big web service providers.
An important concept in REST is the existence of resources (sources of specific information), each of which is referenced with a global identifier (e.g., a URI in HTTP). In order to manipulate these resources, components of the network (user agents and origin servers) communicate via a standardized interface (e.g., HTTP) and exchange representations of these resources (the actual documents conveying the information).
What means RESTful Web API?
A RESTful web API (also called a RESTful web service) is a web API implemented using HTTP and the principles of REST. It is a collection of resources, with four defined aspects:
- the base URI for the web API, such as http://example.com/resources/
- the Internet media type of the data supported by the web API. This is often JSON but can be any other valid Internet media type provided that it is a valid hypertext standard.
- the set of operations supported by the web API using HTTP methods (e.g., GET, PUT, POST, or DELETE).
- The API must be hypertext driven!
The following table shows how the HTTP methods are typically used to implement a web API.
Resource | GET | PUT | POST | DELETE |
---|---|---|---|---|
Collection URI, such as http://example.com/resources/ | List the URIs and perhaps other details of the collection's members. | Replace the entire collection with another collection. | Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation. | Delete the entire collection. |
Element URI, such as http://example.com/resources/item17 Retrieve a representation of the addressed | Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. like json or xml | Replace the addressed member of the collection, or if it doesn't exist,create it. | Not generally used. Treat the addressed member as a collection in its own right and create a new entry in it. | Delete the addressed member of the collection. |
Unlike SOAP-based web services, there is no "official" standard for RESTful web APIs. This is because REST is an architectural style, unlike SOAP, which is a protocol. Even though REST is not a standard, a RESTful implementation such as the Web can use standards like HTTP, URI, XML, etc..