An UmbracoAuthorizedJsonController needs to be called from the Umbraco backoffice. You won’t be able to visit the url itself in the browser. If you just want your own api controller that is public you can use UmbracoApiController
Thanks for the response. I do want the api to be called from the back office. That is where it is to be used.
The only reason I mention visiting the URL is because it was a clear example to me that it isn't working. In my test environment, the routing works as expected and, if I attempt to visit the URL as mentioned above, I get an error generated by Umbraco, saying something to the effect of "GET requests aren't supported", or something like that. However, when I try to visit the URL in my live environment, I get a browser-issued 404 error.
In the back office, when I use the api, in my test environment, they work correctly. But in my live environment, Umbraco just tells me it can't be found.
So I guess my question is, is there something special I need to do to get the auto-routing to work or to happen?
Auto Routing Not Working
I am attempting to create an API. I have saved this file in the App_Code folder:
However, when I attempt to visit https://domain.com/umbraco/backoffice/My/subscriptionpickerapi/getall, I get a 404 error. Why? I ahve a test environment and it works just fine.
Hi Ross
An UmbracoAuthorizedJsonController needs to be called from the Umbraco backoffice. You won’t be able to visit the url itself in the browser. If you just want your own api controller that is public you can use UmbracoApiController
Paul
Thanks for the response. I do want the api to be called from the back office. That is where it is to be used.
The only reason I mention visiting the URL is because it was a clear example to me that it isn't working. In my test environment, the routing works as expected and, if I attempt to visit the URL as mentioned above, I get an error generated by Umbraco, saying something to the effect of "GET requests aren't supported", or something like that. However, when I try to visit the URL in my live environment, I get a browser-issued 404 error.
In the back office, when I use the api, in my test environment, they work correctly. But in my live environment, Umbraco just tells me it can't be found.
So I guess my question is, is there something special I need to do to get the auto-routing to work or to happen?
For some rason, I am no longer getting a direct 404 error when I visit the URL https://domain.com/umbraco/backoffice/My/subscriptionpickerapi/getall. Now, I instead get the following error:
No HTTP resource was found that matches the request URI
So it seems Umbraco is now responding. So that's good. How would I go about fixing this?
is working on a reply...