I'm trying to create some web APIs in a new class library outside of my main website project (still in the same solution). In this library I've added the following API Controller:

namespace My.Custom.Namespace
    public class CustomApi : ServicesApiController
        public HttpResponseMessage TestMethod()
            return Request.CreateResponse(HttpStatusCode.Accepted);

I then add this class library as a reference to my main website project, and try to call the API on this URL:


But I'm only receiving a 404: No HTTP resource was found that matches the request URI

How can I get a ServicesApiController to work from a referenced project/DLL?

Sitecore 8.2 Update 5

  • Why you have /1/ in url? Try removing this and renaming your controller like this "CustomApiController". You are missing the convention to have Controller in the end of name Jun 29, 2018 at 11:39
  • @PeterProchazka Because the specification calls for it. Default routing is /sitecore/api/ssc/{namespace}/{controller}/{id}/{action} according to agehrke.com/2015/08/web-api-controller-in-sitecore-8 I've created and called WebAPIs like this, including the id parameter, from the website project successfully before, but when I follow the same procedure (basically the code in my question) while having the WebAPI in a referenced project/DLL, it doesn't work any more. Jun 29, 2018 at 11:52
  • Can you add string id as parameter of your TestMethod and rename CustomApi to CustomApiController? Jun 29, 2018 at 12:07
  • 1
    The disadvantage of that approach is that I have to implement pipelines and config files. I'd much rather use the other approach where things work "out of the box". I haven't tried your other suggestions yet, but will come back to you with results when I have. Jun 29, 2018 at 12:32
  • 1
    @PeterProchazka It seems to be the naming convention that got me this time. I renamed my class to CustomApiController, and everything started working just fine. Thanks for the point in the right direction, and feel free to add this as an answer and I'll accept it. Jun 29, 2018 at 14:32

1 Answer 1


You should follow MVC naming conventions for Controllers and rename your controller from CustomApi to CustomApiController.

Happy I could help you and that this did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.