using System.Web.Http;
using Umbraco.Web.WebApi;
namespace ContentPlatform.MyWelfare.Controllers
{
public class ContentController : UmbracoApiController
{
[HttpGet]
public string GetContent()
{
return "This worked!";
}
}
}
When testing in postman im pointing at the following endpoint
UmbracoApiController returning 404 error
Hi All,
I'm trying to build a super basic api in umbraco v8.11.1. I've followed the documentation here https://our.umbraco.com/documentation/Reference/Routing/WebApi/
When testing in postman im pointing at the following endpoint
However no matter what i try i'm getting a 404 not found error.
Can anyone give me some advice or guidance on this please?
just a thought but maybe it doesn't like your controller being called content.
Hi Huw,
I thought the same but I renamed it TestController and still had the same issue.
How is your project set up (web app or web site)?
Where does the controller sit in the solution (which folder)?
can't think of anything off hand, your code looks fine and should work.
The only thing I can think of is that it's a website project and the code isn't getting compiled.
If it's a website there should be an App_Code folder that houses this class.
Did you find a solution?
is working on a reply...