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?
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.
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.
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.
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
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
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/.
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
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.
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.
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
is working on a reply...