ASP.NET MVC controller not accessible?

272 views Asked by At

I am trying to reach an controller from my umbraco backoffice, but it seems impossible to do so.

The controller I have created is a simple

using System.Diagnostics;
using System.Web.Http;
using System.Web.Mvc;
using Umbraco.Web.Mvc;

namespace UniversalRobots.Events.Controllers
{
    public class TreeController : UmbracoAuthorizedController
    {
        public ActionResult GetCurrentContentTree()
        {
            Debugger.Break();
            return Content("Somthing");
        }
    }
}

Which according to the documentation (https://our.umbraco.com/Documentation/Reference/Routing/Authorized/index-v8) should be available from

/umbraco/backoffice/api/{controller}/{action}

or in the case of a plugincontroller be available from

/umbraco/backoffice/{pluginname}/{controller}/{action}

I have for now tried this

https://localhost:44313/umbraco/backoffice/api/Tree/GetCurrentContentTree

and

https://localhost:44313/umbraco/backoffice/Tree/GetCurrentContentTree 

both of which return an error:

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

What is the controller endpoint?

1

There are 1 answers

1
I am not Fat On BEST ANSWER

Turned out to be wrong interface I was inheriting instead of UmbracoAuthorizedController it should have been UmbracoAuthorizedApiController