I chose to write about REST APIs this weeek, because we are covering them in class. And because REST APIs are ubiquiutous in Software Development these days. Application program interface or APIs are a a way of sending data between services over the internet. APIs have become popular because they allow companies to use already available tools like email automation, username and password validation, and payment processing to other established services. This allows developers to focus on the unique business demands of their customers and products.
In web development the client is the service or person making requests to access the data within the application. Most often, the browser is the client. A resource is a piece of information that the API can provide for the client. A resource needs to have a unique indentifier. A server receives and fufills client requests. REST stands for Representational State Transfer. When the client requests a resource from the API it comes in the reource’s current state, in a standardized representation.
At my job we have one workflow problem that could be swolved with an API. We have a client side web application where customers place orders, and an internal desktop application where we keep track of primers needed for those orders. The internal desktop application is called the primer log. The client application is a web application, but the internal application is not. This causes our company all kinds of problems. My coworkers will often say “I wish these services could talk to eachother”. And that is exactly what an API does. Our internal application is keeping track of which primers we have, where they are, and which are dry. But the customers cannot see that. Customers will frequently request that we use primers that we do not have onsite.
We will eventually recreate our primer log as a web application, which would allow our client web application and our primer log to communicate. So when a customer requests we use a primer, that would be a client request for a resource from the API. The API would check our internal primer log, and send a response back to the client indicating whether or not the requested primer is onsite. This API response could prompt the client to order the required primer if we did not have it onsite. That is ROI, not to mention the time it would save my team, and the turn around time for our customers. This is just an example of how an API can solve a real life business problem.