Information Technology - Blog V-Soft Consulting

The 4 Secrets to Creating a Great API

Written by Jessica Gassler | Jan 23, 2017 12:01:00 PM

Having a successful API is more than just offering an add-on to an existing function; it can be an enabler that improves your business strategy. If your API is designed well and easy to use it can turn your service into a powerhouse platform. Here are 4 secrets to having a great API.

Design for User Experience

How often do you hear some one say "I just love long waits at the DMV!"? Long wait times and antiquated processes call for serious frustration. In the case of the DMV, it is long overdue for an overhaul to improve user experience. Some DMVs are enabling guests to register their vehicles online, while others require an in-state inspection. Having a stereotypically bad user experience and causing those hearing its name to grimace is something no company should ever have to endure.

An excellent example of a spectacular user experience is Amazon's new prototype grocery store, Amazon Go. Amazon realized that there was a problem with modern grocery stores. More often than not, customers just want to grab their groceries and go, rather than waiting for an available cashier to ring up everything you've picked out and dealing with snotty teenagers. While it is currently only available for Amazon employees, it is proving to be quite promising. Amazon intends to debut the store to the public in early 2017.

To make a great API, you have to make sure it has a great user experience. Avoid causing your users misery by getting feedback early and often. Find the pitfalls and places for improvement in your structure and remedy them immediately.

Creating the perfect API design will enable application developers to better understand the purpose and functionality of the API and give them the opportunity to get up-to-speed rapidly. It will also allow an organization to focus on getting the design right before spending potentially a great deal of time and money on backend implementations. These adjustments can prove to be costly to undo if the design's issues aren't identified until after development and implementation. 

Make Your API Accessible

Start by publishing your API on a developer's network like GitHub. Be sure to include all of your documentation and any other tools another developer would need to learn about and use your API. Remember that other developers haven't invested as much time in your API as you have, and if they don't understand it right away they will skirt off to the next one that fits their needs. Keep all of your documentation clean and easy to consume. Developers are also far more likely to engage with an API that has interactive documentation versus only text.

Ensure that you keep your customers in mind and make sure your API is flexible enough that customers can try it in their own environments. Once you have completed your API, tools, and documentation, and are ready to showcase it, create a plug-and-play version of the API where users can interact with it and get a sense for how it works.

Optimize for a Specific Use Case

It's true that there really is no such thing as a "one size fits all" API. There are times where you may need to run two or more APIs in tandem to support different types of users and use cases. Because of this, your API should be optimized to fulfill a specific business request in a specific context. Far too often APIs are adjusted retroactively by being modeled after the design of backend services are completed, rather than designing them for the use case they fulfill. This results in poor performance of the client application, poor user experience, and ultimately, poor adoption.

The best way to make your API accessible is to think about in which context you will be using it. In this blog post by 3Scale.net, Manfred Bortenschlager states:

"Simplicity of API design depends on the context. A particular design may be simple for one use case but very complex for another, so the granularity of API methods must be balanced. It is useful to think about simplicity on several levels including:

  1. Data Format: Support of XML, JSON, proprietary formats or a combination.
  2. Method Structure: Methods can be very generic, returning a broad set of data, or very specific to allow very targeted requests. Methods are also usually called in a certain sequence to achieve certain use cases.
  3. Data Model: The underlying data model can be very similar or very different to what is actually exposed via the API. This has an impact on usability as well as maintainability.
  4. Authentication: Different authentication mechanisms have different strengths and weaknesses. The most suitable one depends on the context.
  5. Usage Policies: Rights and quotas for developers should be easy to understand and work with."

Be Social

Ignoring the developers using your API can only lead to poor reviews and a lack of adoption. Think of all of those plugins and add-ons you've implemented only to find bugs and incompatibility issues everywhere and the developer was nowhere to be found to help you sift through the errors. It's frustrating, isn't it? Did you provide any feedback on it to warn others to steer clear of that specific plugin or use at their own risk?

Developing an API does not stop when the code is completed. You will need to remain active in the community to succeed. This does not necessarily mean that you should be a social butterfly who is excellent at parties. Rather, be friendly and open to those that are working with and adding onto your API. After all, developing a sense of community with fellow developers is critical to your success. Treating them as valued members of your community can be mutually beneficial. It can increase the reach of your API and improve communication for updates and patches.

The more active you are in a community, the more likely developers are to download your API, and in turn will identify any issues with it much quicker. Learning of a variation of use cases from these developers will also give you insight on where, why, and how your API is utilized in various environments.

Remember that an API is not a static entity; it should be ever-expanding and malleable. Patches, expansions, and enhancements are often times inevitable, and are necessary to procure an excellent API. Great APIs aren't difficult to develop if you design them with your users in mind. If you make it easy for developers to consume your API and actively engage with them, you are well on your way to success.

Want to learn more about APIs and how they can benefit your business? Download this free white paper about API-led Connectivity today.