Sitecore 8.2 and Web API

What is a ASP .NET Web Api ?

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.

How to write a Web Api in Sitecore 8.2 ?

Very easy ! two steps as explained below 🙂

  • Create api controller :

  • Access to controller

To test call to Api, you can use postman, very useful tool 🙂

This is an example of api call from front side with typescript :

  • MVC routes used by Sitecore :

/api/sitecore /{controller}/{action}/{id}

/api/rest/{controller}/{action}/{id}

 

Leave a comment