Best Practices for API Functionality
An API or “application program interface” is a great way to connect software solutions to each other by automating many programs. iSeatz uses APIs to connect travel software inventory into our custom booking solutions and ancillary management systems.
If you are building or maintaining an API, below is a list of features and best practices that your API should allow for. The below best practices are included in all of iSeatz’s APIs.
Detailed Error Messaging and Cataloging
A good error management catalogue in the API allows a consuming system to gain more granular insight into what specific error occurred. This is important as the consuming system may be interacting with end users or consumers directly and may need to provide different error messaging based on the type of error.
There are many different types of errors, including critical errors and recoverable errors, and the system itself may need to take steps related to its own specific business domain that are different based on the type of error it encounters coming from a downstream system.
A good API provides insight as to what type of error occurred along with information about the error so that other connected systems can react accordingly, and with the best user experience possible.
APIs should allow for access control and features. Many APIs communicate over the internet. As we know, bandwidth is not an infinite resource. It takes time to send data over the internet and the size of these payloads can mean the difference of a website loading in 15 seconds or 15 milliseconds. Providing a lot of features in the API that can limit or restrict the data that is coming back depending on the problem you are trying to solve, is a powerful capability in the tool that can allow programmers to manage latency and performance.
For instance, if a user is searching for airline flights for only basic economy fares, an API from the provider should allow the programmer to restrict the flow of more expensive classes from the onset in the request. This brings in a smaller, more specific payload of data, allowing the site to load faster and a better user experience.
APIs should provide flexibility in their use to allow programmers to choose how to leverage the data available.
As software systems evolve, the APIs need to evolve as well. Capabilities are added continuously and semantic versioning allows programmers to be able to better track updates and update their systems accordingly. Computers are very strict in how they speak to each other so any small change may cause something to break.
Versioning allows systems to move forward and advance, while also allowing systems that have dependencies on them the ability to maintain integrity and be aware of specific functionality that is being provided.
Backward capability is also a way to grant older versions of the software to still work. This allows programmers who are connected to the system the ability to use an older version of the API, giving their development team flexibility to make updates to their system when it is convenient for them.
More API Resources from iSeatz:
- Types of Common API Error Messages
- Managing the Unhappy Path: Best Practices Around Failures in E-commerce Bookings
Testing & Staging Environment
Having the ability for developers to run tests in multiple environments prior to the code going into production is essential for a good API.
When you are processing customers credit card, you need to ensure that the proper amount of testing went into the software to ensure you’re not actually creating problems. Having an environment that allows the software engineers to test the code prior to it going live will ensure that the system has less issues and allows a space where bugs can be found before consumers start to use the application.
For example, developers never want to test out a credit card processing code for the first time by actually processing a real credit card and charging real money. Instead, having the ability to virtualize or simulate that functionality in a test environment, allows the developer to make sure it works correctly and is secure before any consumer’s sensitive information is entered into the system.
99.99% Uptime and Low Latency
Many APIs handle large amount of traffic requests. APIs should be available to process requests quickly.
If the API is down, and is not able to process requests, this can lead to lost revenue for the company and headaches for the end-consumer. Additionally, if the API is up, but is slow, this can also affect user experience and ultimately cause a reduction in use from the consumer.
Good APIs are robust, available systems. In the world of e-commerce, consumers are not patient. If an API is not reliable and it’s not up all the time, you lose people because they can’t be sure it’s going to work and they know that a competitor’s system will.
Broad Programming Language Support
There are thousands of programming languages in the world and new ones are being created every day. Additionally, there are a lot of different tools that people use to design their software systems.
APIs help solve business problems in a globalized economy. Successful APIs will be written so that they have the ability to return descriptive content in multiple languages, including eastern languages, and currencies.
Polite and Graceful
A “polite” API acts with a summarization of a lot of the items discussed above. The API will be very descriptive about the errors that occurred so two computer systems can have the highest level of collaboration with each other to solve the error. Additionally, the API will not throttle requests (or severely limit the amount of throttling) and be available for developers to use the API.
APIs are robust software systems that allow e-commerce websites to function quickly and efficiently. iSeatz utilizes APIs in our OneView platform to create elegant travel booking engines with broad supply of travel inventory.