Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christian Stenfors 80 posts 124 karma points
    Jun 18, 2013 @ 17:22
    Christian Stenfors
    0

    learning and using the Umbraco CMS API

    After CodeGarden13, i learned a bunch and meet so many smart minds, so now i thought that i would give it a go, and learn some (for me) new stuff.

    First up in that list is the Umbraco API.

    I (think i) have followed the documentation on creating a web api controller like explained here: http://our.umbraco.org/documentation/Reference/WebApi/

    I then compiled the DLL and dropped that in my newly created Umbraco V.6.1.1 site.

    Then i though that i could visit this URL = /Umbraco/Api/ProductsApiController, and that it would return my "hello World" string.

    But i get nothing in return. Just a 404. Can someone help me out, please?

  • Steve Temple 63 posts 324 karma points MVP 4x c-trib
    Jun 18, 2013 @ 18:03
    Steve Temple
    0

    Try  /Umbraco/Api/ProductsApi if it works like MVC you don't need the controller part

  • Christian Stenfors 80 posts 124 karma points
    Jun 19, 2013 @ 09:26
    Christian Stenfors
    0

    That did not work.

    Any other idea?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 19, 2013 @ 09:38
    Jeroen Breuer
    0

    Maybe this blog can help? http://www.nibble.be/?p=224

    Jeroen

  • Comment author was deleted

    Jun 19, 2013 @ 09:58

    @Christian, you also need to inlcude the method name, routing based on the http method doesn't work with the ApiController (and you don't need the Controller part like Steve mentions)

    /umbraco/api/StatusApi/GetAllStatuses/

  • Comment author was deleted

    Jun 19, 2013 @ 10:05
  • Christian Stenfors 80 posts 124 karma points
    Jun 19, 2013 @ 10:23
    Christian Stenfors
    0

    Thank you for the link. That looks exactly as an example of what i want to try to do.

    But i can't open the Visual Studio Solution, or Project. I have Visual Studio 2010 on my machine.

    When i just try to run the project under File > Open website, i get a "Could not load type 'Umbraco.Web.UmbracoApplication." related to the Global.asax file

    I is just not my day today :,(

  • Comment author was deleted

    Jun 19, 2013 @ 10:24

    Yeah it's a vs2012 solution maybe that's why

  • Christian Stenfors 80 posts 124 karma points
    Jun 19, 2013 @ 10:27
    Christian Stenfors
    0

    Whups.... i haven't refreshes this page in my browser, so did not see all your posts :-0

    @Tim, adding the methodname did the trick! A thanks to all of you for helping me out.

Please Sign in or register to post replies

Write your reply to:

Draft