Here is my setup, I've got a studio project which generates an assembly with only the following class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Umbraco.Web.WebApi;
namespace engsoft_cms
{
publicclassProfilesV1ApiController : UmbracoApiController
{
[HttpGet]
publicstring Get()
{
return"HI!!! HAPPY DAYS!!";
}
}
}
I copy this to my server's bin directory, recycle the worker process, then when I try to access http://mysite/umbraco/api/profilesv1api/ ; I get a 404. I've also tried /umbraco/api/profilesv1 /api/profilesv1api/ etc. I feel like I am missing something obvious.
The server is running on Server 2012 Umbraco 7.2.5
Thanks for the link to the docs, I should just bookmark this for when I invariabily forget.
Thankfully, late in the day, I figured out what the problem was. I accidentally updated the microsoft libraries from nuget. Because of assembly version mismatches my assembly wasn't loading and the calls were throwing errors.
A new avenue I need to now explore is why I was not seeing any error output in the trace log and event vewer.
404 error when trying to access api controller
Here is my setup, I've got a studio project which generates an assembly with only the following class:
I copy this to my server's bin directory, recycle the worker process, then when I try to access http://mysite/umbraco/api/profilesv1api/ ; I get a 404. I've also tried /umbraco/api/profilesv1 /api/profilesv1api/ etc. I feel like I am missing something obvious.
The server is running on Server 2012 Umbraco 7.2.5
Hi Nathan
You should be able to go to /umbraco/api/profilesv1/Get and then see the "HI!!! HAPPY DAYS!!" text.
Don't know if you have seen the documentation about this here? https://our.umbraco.org/documentation/Reference/WebApi/
/Jan
Hello Jan,
Thanks for the link to the docs, I should just bookmark this for when I invariabily forget.
Thankfully, late in the day, I figured out what the problem was. I accidentally updated the microsoft libraries from nuget. Because of assembly version mismatches my assembly wasn't loading and the calls were throwing errors.
A new avenue I need to now explore is why I was not seeing any error output in the trace log and event vewer.
Hi Nathan
You're welcome and thanks for sharing what you learned - Others might benefit from this :)
/Jan
is working on a reply...