Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Trying to set up a simple WebApi endpoint, using a custom route (ie not ~/umbraco/api/foo/bar) - figured it would be a matter of adding the WebApiConfig class, invoking it, and then using route attributes in my controller, inheriting from ApiController.
I figured wrong - I get 404s on all routes. Wondering if there's any other Umbraco logic I need to be aware of, or if I'm just missing something obvious.
I know code samples would help, but I'm at home and the code is at work...
Have you read through the Api Controller docs, it goes into pretty good detail as to how they should be setup in Umbraco
Hope this helps
Thanks Matt, read through that earlier. Should I be able to define my own routes against a controller inheriting from UmbracoApiController? It's not critical, but I'd prefer to define my own via attributes...
Had a similar problem getting web api working after umbraco was installed in a project.
This blog post solved the problem for me, it appears you need to register your custom web api routing after umbraco has started and registered its routes.
Hi everyone I was able to make this work but unfortunately this page is formatting it incorrectly so these are my pics of how I made it work in Umbraco V8:
Created a composer:
Created a custom controller inheriting from UmbracoApiController:
I tried your solution. It was very easy to implement. But I'm getting 404 response. Any idea what can be the issue?
Hope to hear from you,
404 means the endpoint is not being found. please be sure you are calling the api with all the parameters, that you're inheriting from UmbracoApiController and the Composer matches the one in the example.
If you don't find where the issue is, feel free of pasting here your code or more details about your implementation so that I can give it a look.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted