How to build RESTful APIs with ASP.NET Web API 2 – Introduction


RESTful APIs are everywhere these days. They are a great way to integrate your applications with third party services. Most SaaS providers offer an API interface for their software applications. RESTful APIs are even first class citizens of both AWS and Azure. It is becoming more and more unlikely that you will work on an application that doesn’t interface with some sort of API. In fact, most projects these days usually include their own RESTful API interfaces that are either used internally or exposed externally for others to consume.

RESTful-AreaMost application that I have worked on lately have one or more API components. Nowadays, those tend to be ASP.NET Web API application.  In fact, I have been working on ASP.NET Web API projects almost uninterrupted for the past 4 years. Every time I’ve done so, I’ve had to work through a lot of the same problems with the other developers on those projects. The same type of issues keep coming up time and time again. I’ve had the opportunity to work through all of these issues multiple times and I think that has been very valuable. I’ve made a lot of mistakes along the way, but I have also come up with a few general guidelines that make implementing these types of applications a whole lot easier.

In this blog series, we’ll be looking at some of these recurring issues and how to implement some possible solutions to them. We will also go over some of the lessons that I have learned from working on ASP.NET Web API projects over the last few years. Specifically, we will be focusing on the following areas.

  • Versioning
  • Authentication
  • Authorization
  • Logging
  • Auditing
  • Monitoring
  • Exception Handling
  • Validation
  • Request/Response Contracts
  • Testing
  • Querying

Each one of these bullet points will be a separate blog posts that will build on the ones before it and include sample code along with other useful tidbits. In the end, we will have gone through all of these components and have a functional example of a RESTful API build with ASP.NET Web API 2. We will have implemented some of the best practices that I’ve identified through trial and error while working on these types of applications. As I publish new posts in this series, I will link to them from here so feel free to bookmark this page and check back every so often to see updates.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

  • calum bett

    Are going to continue this series? It looked very promising.

    • Miguel A. Gonzalez

      Yes, I will be continuing this series. Sorry for the delay. I’ve been pretty busy for a few months, but I’m freeing up now and will be picking this back up. Look for another blog blog post in the next few days.

      • calum bett

        Brillant. Looking forward to it.