Today I needed to expose some REST functionality in the project, which leverages Sitefinity, via ASP.NET Web API.
Standard routing setup didn't work out for me. There is a little gotcha. You have to register routing after Sitefinity bootstraper is initialized:
Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(this.AfterInit);
private void AfterInit(object sender, ExecutedEventArgs args)
{
if (args.CommandName == "Bootstrapped")
{
WebApiConfig.Register(GlobalConfiguration.Configuration);
}
}