APIs are the term used to describe web services that connect different platforms or data services together. An example is the Uber application. The way that you search, book, and pay are all done through APIs.
APIs are not complicated, they are just data. When you search for vehicles in the Uber API, it makes this HTTP call:
The response is in JSON format and human readable. Here is a snippet:
"description": "Shared rides, door to door"
There are many different types of APIs, the term itself has become vague unfortunately. For our purposes we will always be talking about HTTP APIs. APIs that can be hit with an HTTP call.
There are two types of HTTP APIs, REST and SOAP. That is a huge topic, but from a very high level:
This was the most commonly used format, but is now seen as a legacy technology. It’s advantage is that it’s simple and can return a bunch of data. The negative is that it is very poor for more interactive usage, like we see with mobile applications today.
REST is the most common protocol we see today, and more robust overall. It’s specifically made for interactive usage, such as mobile applications.
Raising in popularity and made by Facebook.
The response of an API call can come in many different formats. Again, for simplicity we will just focus on the ones that apply to what API Fortress can test.
This is a very straightforward format that can return in virtually any layout. An example:
<?xml version="1.0" encoding="UTF-8"?> <XML> <note> <to>Patrick</to> <from>Mom</from> <subject>Reminder</subject> <body>We need milk</body> </note> </XML>
This is the more commonly seen format in REST APIs today. The Uber example is in JSON. It’s more standardized and therefore cleaned for machines to understand.
This is the item that has data associated with it. If you look at the Uber response again, display_name, description, and Image are examples of objects.
A rule or specific test against a single object and/or piece of data. The API Fortress platform is powered by a proprietary XML language with over 70 assertions, that handle just about every scenario in a very quick and easy way to write.