From Wikipedia, the free encyclopedia
  (Redirected from Web api)
Jump to: navigation, search
For the Microsoft ASP.NET Web API, see ASP.NET MVC Framework.

A web API is the application programming interface (API) for both the web server and web browser. It gathers definitions, procedures and protocols to help the communication between different computer softwares. HTTP services for example, is built by ASP.NET Web API in order to reach a variety of clients such as smartphones, tablets. In addition it is an ideal platform for building RESTful applications on the .NET Framework.[1]


A server-side web API is a programmatic interface to a defined request-response message system, typically expressed in JSON or XML, which is exposed via the web—most commonly by means of an HTTP-based web server. Mashups are web applications which combine the use of multiple such web APIs.[2] Webhooks are server-side web APIs that take as input a URI that is designed to be used like a remote named pipe or a type of callback such that the server acts as a client to dereference the provided URI and trigger an event on another server which handles this event thus providing a type of peer-to-peer IPC.

While web API in this context is sometimes considered a synonym for web service, Web 2.0 web applications have moved away from SOAP-based web services towards more cohesive collections of RESTful web resources.[3] These RESTful web APIs are accessible via standard HTTP methods by a variety of HTTP clients including browsers and mobile devices.


A client-side web API is a programmatic interface to extend functionality within a web browser or other HTTP client. Originally these were most commonly in the form of native plug-in architectures however most newer ones target standardized JavaScript bindings.

The Mozilla Foundation created their WebAPI specification which is designed to help replace native mobile applications with HTML5 applications.[4][5]

Google created their Native Client architecture which is designed to help replace insecure native plug-ins with secure native sandboxed extensions and applications. They have also made this portable by employing a modified LLVM AOT compiler.

ASP.NET Web API Character[edit]

•Advanced HTTP programming model: using the new HTTP object model also the HTTP client uses the same programming model and HTTP pipelining.

•Support routing: Web API fully supports ASP.NET routing, including routing parameters and constraints.

•Content negotiation: The client and server can work together to determine the format of the data returned by the API. Default support XML, JSON and Form URL-Encoded format, can be extended to add custom formats.

•Model binding and validation: model binder can easily extract data from the HTTP request and converted into Net objects.

•Based on the configuration code: Web API code complete the configuration,ensuring the cleanliness of the configuration file.

•Self-hosted (Self-Host): Web API is hosted in IIS, you can also hosted in the process, you can still use the route as well as other features.

•Improved Http details testability: Web API is not the HTTP details set to a static Context object, but the use HttpRequestMessage and HttpResponseMessage.[6]

Differences between Web API and Web Services[edit]

Web Service[edit]

Web service is basically a standard interaction between different electronic devices.[7]

Examples of web services include: SOAP, REST, and XML-RPC.

Web API[edit]

Web API is one of the Web services based on HTTP and it is a set of data structures to help different applications. However it is undefined, which means everyone can provide their description just by PDF and it is not standard.[8]

Web API Features[edit]

The main features of Web API.[9]

•Express different meanings by different http action.

•Responses have different meanings through Http Status Code and the client can Accept header to negotiate with the server format.

•Responses format supports JSON, XML, and can be extended to add other formats.

•It has automatic support for OData.

•Support Self-host or IIS host.

•Most MVC support functions, such as Routing Routing/ Action Result / Filter / Model Builder / IOC Container / Dependency Injection Dependency injection

API Types[edit]

API is divided into Web service APIs, Library-based APIs, Object remoting APIs and Hardware APIs.[10]

Web service APIs[edit]

Web Service is a system that can be accessed by URL. HTTP is used to exchange information, which can be understood by other applications in a format.

Examples of Web Service[edit]

SOAP (Simple Object Access Protocol)[edit]

By definition Soap is the communication process and the structure of the messages.[11]


XML-RPC is an Internet protocol, using a specific XML format to transfer data.[12]


JSON-RPC is an RPC protocol, using JSON data format. It can be used in various systems and environment based on the structure of Internet, also it can be used over sockets, over http, or in many different message passing environments. The advantage of JSON-RPC would be small volume and relative simple formats.[13]

REST (Representational state transfer)[edit]

REST (Representational state transfer) is not a protocol while it is an architecture. It is a network application for the design and development of methods that can reduce development complexity, improve system scalability.

REST made a number of design concepts and guidelines:

•All the things on the network are abstracted into resources

•Each resource corresponds to a unique resource identifier

•Adoption of a common connector interface to operate on resources

•The various operations on resources will not change resource identification

•All operations are stateless

It is used in different aspects such as business process and mobile applications.[14]

Library-based APIs[edit]

This type of API can only be accessed when an application is reference the code of library and then can use the library functions to exchange the information.[15]

Class-based APIs (object oriented)[edit]

Class-based APIs (object oriented) is a special type of library-based API organised by classes to provide data. Different information and associated behaviors should be given of a specific concept.

Object remoting APIs[edit]

Object remoting APIs use a remoting protocol, which works by implementing local proxy objects to represent the remote objects, and interacting with the local object. [16]

Hardware APIs[edit]

Hardware APIs deal with the hardware on a device.[17]

Sample of Web APIs in different Services[edit]

There are 5 basic services on Web Platform. Different forms of APIs are provided in each one.[18]

Information Services[edit]

Information Services provide massive specific information, including geographical data like Google Maps API,[19] which is designed for developers to provide a common interface using Simple Object Access Protocol (SOAP)[20] like the Amazon E-Commerce,[21] Product Data Amazon historcal Pricing Services [22] and the latest release of Yahoo. These services have in common is that they provide simple API to access massive amounts of data, which could lead to unpredictable cross-application information.

Storage Services[edit]

Storage services concern abstraction and virtualization storage. Leader in this area is amazon s3. For developers, S3 provides an extremely streamlined abstract API, allowing easy access to information.


Message Services[edit]

Because of the complexity of the technical and commercial, message service has not been in a large-scale development. Short term visible web-based communications services is Amazon Simple Queue Service. This service enables any application between security and scalable queue-based communication more convenient.[24]

Search Services[edit]

Because searching is the base and dominance in the field of web, search services are a key part of the new web infrastructure. An example is Alexa search platform, which led to a series of challenges designed vertical position google search engine.[25]

Web2.0 Services[edit]

Web2.0 services contain information such as del.icio.us Delicious (website), flickr Flickr, basecamp

API Modeling Languages[edit]

A number of Modeling languages have been proposed for describing practical Web APIs including:

See also[edit]


  1. ^ Wasson, Mike. "Microsoft ASP.NET". Microsoft ASP.NET. Retrieved 20 January 2014. 
  2. ^ "Mashup Dashboard". ProgrammableWeb.com. 2009. 
  3. ^ Benslimane, D.; Dustdar, S.; Sheth, A. (2008). "Services Mashups: The New Generation of Web Applications". IEEE Internet Computing 10 (5): 13–15. doi:10.1109/MIC.2008.110.  edit
  4. ^ WebMonkey News
  5. ^ Mozilla WebAPI Wiki
  6. ^ zhang, zhimin. "ASP.NET Web API". 
  7. ^ McIver, Aaron. "web service". programmers. Retrieved 21 January 2011. 
  8. ^ D., Ranjan. "web API". code project. Retrieved 11 March 2013. 
  9. ^ Chauhan, Shailendra. "Web Api Feaures". dotnet-tickets. 
  10. ^ Maddox, Sarah. "API types". FFEATHERS. Retrieved 16 February 2014. 
  11. ^ Rouse, Margaret. "SOAP (Simple Object Access Protocol)". 
  12. ^ Winer, Dave. "XML-RPC Specification". Retrieved 15 June 1999. 
  13. ^ "JSON-RPC 2.0 Specification". 
  14. ^ Rouse, Margaret. "REST (representational state transfer)". 
  15. ^ IEEE. Parallel and Distributed Simulation. IEEE. pp. 154–161. ISBN 0-8186-8457-7. 
  16. ^ Surapaneni, Narayana. Java & .NET: A Developer's Guide to Interoperability and Migration. 
  17. ^ Weiss, Ray. "Ray Weiss". Retrieved 22 January 2001. 
  18. ^ "web Api". 
  19. ^ Gibilisco, Stan. "google maps". whatls.com. Retrieved February 2013. 
  20. ^ "Introduction of SOAP". 
  21. ^ .O, admin. "Amazon E-Commerce". awsbook. Retrieved 25 October 2014. 
  22. ^ Shanahan, Francis (3 January 2007). Product Data Amazon historcal Pricing Services (1 ed.). wrox. ISBN 978-0470097779. Retrieved 25 October 2014. 
  23. ^ Rouse, Margaret. "Amazon S3". whatls. Retrieved 25 October 2014. 
  24. ^ Singh, Niraj. "Amazon Simple Queue Service using java". jave code greeks. Retrieved 25 June 2013. 
  25. ^ Nguyen, Michael. "Alexa Web Search Platform". SEJ. Retrieved 13 December 2005. 

Further reading[edit]