RESTful APIs in practice

The Pure Doctrine

Conclusions

The three APIs featured in this article stick firmly to the REST principle. At the same time, by choosing JSON, none of the three use a genuine hypermedia format but take a pragmatic approach with their own JSON specifications. Formally, they fail the REST check.

The operating principle of the hypermedia format can be imitated in JSON; Twitter does a better job of this than WordPress.com, whereas figo keeps too much to simple tables of values to use hypermedia options consistently. The processes shown in the documentation with their branches can be mapped well in a hypermedia format; the API does not fully grasp the opportunities here.

All three manage without difficulty to abstract the data, creating an application layer and a user-oriented presentation layer, which is in the interest of providers, because it has a positive effect on version maintenance. The user aspect is particularly evident with Twitter and figo.

In terms of the process, figo is a bit more difficult because it depends on payment transaction mechanisms and the customer-bank dialog, but the problem is solved within the framework of its possibilities.

For all three of the APIs presented here, you can see that the implementation of RESTful principles are understood for three of the four criteria. Against the background of advancing developments in the field of artificial intelligence, it would certainly be preferable to include hypermedia more consistently, because that means an API can intuitively navigate along a desired process from one resource to another. At the same time, it clearly marks multimedia resources as such. This facilitates the machine readability of the code and therefore the ability to automate integration.

Infos

  1. "REST APIs" by Marcus Nasarek, ADMIN , issue 40, 2017, pg. 92, http://www.admin-magazine.com/Archive/2017/40/Developing-RESTful-APIs
  2. Twitter: https://twitter.com
  3. WordPress: https://www.wordpress.com
  4. figo banking services: https://www.figo.io/en/
  5. Twitter REST API documentation: https://dev.twitter.com/rest/reference
  6. OAuth protocol: https://oauth.net
  7. Twitter developer platform: https://dev.twitter.com
  8. Twitter development library: https://dev.twitter.com/resources/twitter-libraries
  9. Twurl, a Ruby-based Twitter API tool: https://github.com/twitter/twurl
  10. JSON data exchange format: http://www.json.org/json-en.html
  11. WordPress.com REST API documentation: https://developer.wordpress.com/docs/api/
  12. HAL standard: https://tools.ietf.org/html/draft-kelly-json-hal-08
  13. WordPress.com development portal: https://developer.wordpress.com
  14. FinTS bank standard: https://www.hbci-zka.de/english/
  15. figo API documentation: http://docs.figo.io
  16. figo on GitHub: https://github.com/figo-connect

The Author

Marcus Nasarek is completely devoted to scripting, Ruby, and projects based on the Raspberry PI.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Developing RESTful APIs
    The popularity of REST APIs has increased of late, not only on industry sites, but also in the framework of smaller projects. We explain why this is so and illustrate the fairly abstract architectural approach with a concrete example.
  • Swagger and OpenAPI Specification for documents
    A REST API is especially useful for a developer if the API provider extensively documents the methods used. The Swagger tools not only semiautomatically generate an API reference, but a matching client SDK for many programming languages, as well.
  • What's new in SQL Server 2016
    The focus in SQL Server 2016 is on mobility, cloud usage, and speed, with improvements to in-memory processing and security.
  • What's new in PostgreSQL 9.4
    The PostgreSQL Global Development Group recently introduced the new major version 9.4 of the popular free database, which includes innovative functions as well as a whole range of changes regarding speed and functionality.
  • Automating the Azure infrastructure using a command-line interface
    When it comes to merging the cloud with local resources, Azure offers some useful automation tools.
comments powered by Disqus