Copied to clipboard

Flag this post as spam?

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


  • Matt Taylor 873 posts 2086 karma points
    Oct 14, 2016 @ 10:31
    Matt Taylor
    0

    Web services in Umbraco to change content

    I've created standard .Net web services for my Umbraco projects in the past to query or manipulate content but I'm wondering what the best practice is now in Umbraco 7.

    Could someone point me in the right direction of things I should be doing/using?

    Kind regards,

    Matt

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Oct 14, 2016 @ 10:36
    Alex Skrypnyk
    0

    Hi Matt,

    What do you mean services for my Umbraco project?

    Are you changing content via HTTP and services?

    Umbraco has possibility to build REST API for it - https://our.umbraco.org/documentation/reference/routing/webapi/

    Thanks,

    Alex

  • Marcin Zajkowski 112 posts 585 karma points MVP 6x c-trib
    Oct 14, 2016 @ 10:37
    Marcin Zajkowski
    100

    Hi Matt,

    you can use UmbracoWebApiController class and extend it with your controller what will give you a standard WebAPI controller with Umbraco helper and context injected into it. You can find more about it here: https://our.umbraco.org/documentation/reference/routing/webapi/. Inside of the methods you can use standard Umbraco Services (https://our.umbraco.org/documentation/reference/management/services/) to manipulate the content or any other aspects inside your solution.

    You can also play with Umbraco REST API. I wrote a blogpost describing how to start with it: http://24days.in/umbraco/2015/umbraco-rest-api/.

  • Matt Taylor 873 posts 2086 karma points
    Oct 14, 2016 @ 10:48
    Matt Taylor
    0

    Thanks Marcin,

    I did come across your 24days article and thought it might be what I should use.

    I've also seen some people saying that webapi or REST api is broken out of the box? Is that still the case?

    Cheers, Matt

  • Marcin Zajkowski 112 posts 585 karma points MVP 6x c-trib
    Oct 14, 2016 @ 10:54
    Marcin Zajkowski
    0

    Better call it "work-in-progress" rather than broken :) It works, but still require some attention especially around security and authorization. Both scenarios may satisfy you. Personally I'm usually using WebAPI controllers.

  • Matt Taylor 873 posts 2086 karma points
    Oct 14, 2016 @ 10:46
    Matt Taylor
    0

    Thanks Alex, what I mean by web services is for me to program public methods that manipulate my site's content that can be called by other applications.

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Oct 14, 2016 @ 10:48
    Alex Skrypnyk
    1

    Matt, UmbracoWebApiController is the best way for doing it. It's my opinion, you can get or change content, add authentication and stuff like that.

    Please, share result of your work here, it will be nice.

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft