Magnus Udbjørg | 27/05/2021
Waiters, recipe thieves, and your playlist – My two cents on APIs
At Mono, we build our products as an API first approach. We believe that the best practice is to not tie our customers down to how we think our application should work, but instead, let them innovate and build new products on our platform.
We are not the first to have this approach, both Amazon and Twilio came before us, but Mono caters specifically to small businesses and therefore has unique insights. Insights that I will now share with you.
Read along as I take you on a journey of (Mono) APIs.
Application programming interfaces — more commonly known as APIs — are what enable different programs to work together in different ways; from mobile experiences, connecting companies to the web, and enabling platform business models.
For example, APIs power Amazon’s cloud business, Google Ads, Facebook likes, and even the weather app on your iPhone. Instead of having all global weather forecasts on the app, the app pulls the weather forecast from multiple sources via APIs.
At Mono, an API is a user interface that communicates with the backend of the Mono Solutions code.
APIs are often compared to a waiter at a restaurant. In a restaurant, you can ask the waiter anything about food, the menu, or the bill. The waiter is now shielding you from having to think of the complicated process that lies behind closed doors, such as the stoves, kitchen equipment, raw materials needed to make the food, etc.
The waiter is the interface between the customer and all the services that the restaurant offers. The waiter thus communicates orders between the customer (which could be an internet browser) and the kitchen (the back-end service the customer is trying to access).
Stay with me.
So you (the customer) places an order with the waiter. The waiter takes it back to the kitchen, then comes back with what you ordered on a neatly organized plate.
This solution is good for everyone, as the customer does not have to worry about all the back-end stuff, and the kitchen does not have to worry that the customer might steal recipes.
In this scenario, Mono Solutions’ platform is the kitchen, Mono’s API is the waiter, and you are the customer. However, you can be anything, you can be a person, a program, or even a piece of code.
But let’s not confuse things. Let’s say that you are you - a person. You send a request to the waiter (the API) for a new page on the website, e.g. a new page in the Mono Editor, the waiter now goes back to the kitchen, e.g. the Mono website platform, to get the code for a new page and returns it to you.
Now this is what happens in plain terms, however in its pure form you don’t even have a user when talking API, it’s pure code, meaning that a code asks a code for another code. No person needs to be involved.
Also, there will be an interface, whether you are using your phone, a browser, or something else. So, there are more layers than the waiter. But for now, let’s stick to our waiter example as we move onto the different types of APIs.
There are basically three models of APIs, depending on one’s definition:
Simple Objects Access Protocol is a web communication protocol designed for Microsoft back in 1998. It is a messaging format that is based on XML (Extensible Markup Language). SOAP has stricter rules, which makes it harder to use for novice developers.
REST or RESTful API design (Representational State Transfer)
Is a simple, less strict model for implementing API’s using a subset of the HTTP protocol. This means that you essential can access a REST API using your own browser. – This is what Mono uses.
GraphQL Is a query language for APIs and a way to return data based on the query. GraphQL provides an understandable description of the data in your API, gives users the power to request precisely what you need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools. GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.
As mentioned, Mono uses the REST API design, meaning that it takes advantage of HTTP. The Mono API is the interface to the Mono website platform and is divided into three legs:
With the Mono HAL API, you can perform an extensive range of actions related to multi-site management. You can create sites, add and manage subscriptions, register domains, enable SSL, and much more.
This API is used a lot. In our waiter scenario, the customer would be Mono’s Reseller Admin Interface (RAI), the waiter is HAL, and the Mono website platform is the kitchen. RAI is thus a layer upon the HAL API.
With the Mono Site API, you can perform various actions in the Editor such as adding, editing and deleting settings and Global Data. The Site API also covers additional Mono products managed through the Editor, like our E-commerce and Blog add-ons.
The Mono Tracking API allows you to easily set up tracking for custom events – such as number of links clicked, number of forms sent, number of files downloaded, etc. - or adding any third-party providers.
API is not a tool for all, but for those who have the skill, this can be a powerful tool to build new services or innovate upon.
Using the API from us will enable you to build up your own products without worrying about having 100’s of engineers to build and maintain your new products.
Using API like Mono’s open up for a vast range of possibilities, where you as a reseller or website owner can automate reoccurring tasks or build new products on top of the existing ones.
You can combine multiple different SaaS API into more extensive and more innovative service offerings that enable you to work smarter or get into new markets. As a website owner, you could use a review API to pull all your reviews and add them to your website, so you don’t have to do it by hand or worry about remembering it.
As a reseller, you can build your own self-serve platform on top of our HAL API to eliminate non-value-adding tasks and give the power to your users.
Mono using an API-first approach means that we set our customers free to do with our platform as they see fit. For instance, if a reseller comes and says they would like to use Salesforce, they are free to do so.
Using our restaurant analogy, the customer is Salesforce, the kitchen is the Mono platform, and the waiter the Mono API. Salesforce is then used instead of the Mono RAI.
With this method, the reseller is free to manage all aspects of his/her business as they see fit. This means that the reseller never has to connect with the Mono software, as long as they are connected to the Mono API. This can be compared to Apple, where software developers develop on Apple's APIs, so that you as the customer can go to the Apple store and download their apps.
Mono enables its users to do everything themselves. This means that the user can even make their own Mono Editor if they want to, then Mono would just make the hosting available. The user would even be able to use their own API.
Our API is that flexible.
However, this approach is more geared towards resellers and small businesses operating with fulfillment partners. As it is mainly developers that sit down and start to code, this is simply too big of a challenge for small business owners.
The motto “API first” is thus a way to empower the reseller and SME. Mono does not force you through any system but enables you to build your own on top of the Mono platform.
What this means is that Mono delivers the website and hosts it, the API makes sure that you get all the features you need in order to build and you are then able to add different features such as domain and SSL.
No one ever needs to know you are building on Mono software, as long as you build on the API. It also means that Mono has a high degree of flexibility, as we for instance never have to change anything on our platform in order to make a new Editor.
The reason for our focus on API-first at Mono is because we have our resellers’ and small business customers’ best interest in mind. An API gives you the possibility to control your own business and build your own business around our products. And that’s what Mono stands for - helping small businesses become the best they can be.
Magnus Udbjørg is the VP of engineering at Mono Solutions. Magnus has a management and computer science background with experience ranging from small start-ups to LEGO. With experience from the whole stack of engineering, he brings a wealth of knowledge; the recent focus has been bringing DevOps to life in the engineering culture.