SDL Tridion Core Service content exposed via a REST web service

I’ve recently had to implement a REST web service that exposes SDL Tridion Core Service content.  I was surprised by how easy it was and thought that I’d highlight the relevant parts to encourage others to try it.

My REST web service is part of an MVC website that has it’s own collection of controllers.  So I’ve elected to put my REST controllers into a sub-folder called CMS.


In Visual Studio a default MVC application also has an App_Start folder with a WebApiConfig.cs file inside it.


The Global.asax.cs file hooks it up to the Application_Start event.


By default this code adds a ‘Route’ of “api/{controller}/{id}”.  However I’ve modified ours to be “CMS” instead of “api”.


That’s all the infrastructure in place, now we just need to populate the controller (added in screen shot #1 above).

Take a deep breath and prepare yourself folks, it’s about to get super complex……


So I’ve only hooked up lines 13 and 19 for now.  But what that code means is we can do this:


And this:


A REST web service exposing Tridion content via Core Service.  Don’t forget to secure the thing!

2 thoughts on “SDL Tridion Core Service content exposed via a REST web service

  1. Nice, Mark and thanks for sharing. This makes a whole lot of CM-side reporting, analysis, and generated documentation ideas that much easier to implement.

    Oh and a gentle reminder for our dear readers–do “try this at home,” just not in delivery. :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>