One of the most popular types of API is REST or, as they’re sometimes known, RESTful APIs. REST or RESTful APIs were designed to take advantage of existing protocols. While REST - or Representational State Transfer - can be used over nearly any protocol, when used for web APIs it it typically takes advantage of HTTP. This means that developers have no need to install additional software or libraries when creating a REST API.
One of the key advantages of REST APIs is that they provide a great deal of flexibility. Data is not tied to resources or methods, so REST can handle multiple types of calls, return different data formats and even change structurally with the correct implementation of hypermedia. This flexibility allows developers to build an API that meets your needs while also meeting the needs of very diverse customers.
Unlike SOAP, REST is not constrained to XML, but instead can return XML, JSON, YAML or any other format depending on what the client requests. And unlike RPC, users aren’t required to know procedure names or specific parameters in a specific order.
But one of the disadvantages of RESTful APIs is that you can lose the ability to maintain state in REST, such as within sessions. It can be more difficult for newer developers to use.
It’s important to understand what makes a REST API RESTful, and why these constraints exist before building your API.
To find out more about designing RESTful APIs, and to discover whether a RESTful API is the right one for your project, download the eBook Undisturbed REST: A Guide to Designing the Perfect API.
Next, learn how designing a great API spec will save you time and money in the long run.