Copied to clipboard

Flag this post as spam?

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


  • Antonios Fesenmeier 4 posts 75 karma points
    Nov 19, 2015 @ 14:25
    Antonios Fesenmeier
    0

    Umbraco RESTFUL API PUT, POST & DELETE

    Hello everyone,

    actually we try to use Umbraco with Java, while using Umbracos REST API v1. After a few tries we could access some of the GET-Methods, but at the moment we aren't able to use PUT/DELETE or POST Calls.

    Is their some piece of documentation which display a list of available REST-Callls? At the moment we use the documentation of the Content-Service to get an idea about the methods, (ContentService) but we aren't able to send requests to create or delete content...

    We also checked the allowed verbs in the IIS-configuration.

    Can anyone give me some hints? Here is an example call send over postman: .../umbraco/rest/v1/content/Delete?id=1111

    With the DELETE Request we didn't receive an error but nothing is happening?

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Nov 23, 2015 @ 12:31
    Dennis Aaen
    0

    Hi Antonios,

    Have you seen the Rest Api documentation, if not then you can find it here https://our.umbraco.org/documentation/Implementation/Rest-Api/

    Hope this can help you a step further.

    /Dennis

  • Alexander Brückner 8 posts 75 karma points
    Nov 24, 2015 @ 09:20
    Alexander Brückner
    0

    First of all i want to thank you for an outstanding evening @umboktoberfest 2015. I hope all umbraco people went home safely.

    We talked together @umboktoberfest about the RestApi. We have already work through the documentation. The GET-Methods works fine. Now we need some hints about how to use PUT/DELETE or POST calls.

    Can you give us some example? Maybee how to delete a tree in the Content-Section?

    Thanks in advance Alex

  • Shannon Deminick 1524 posts 5270 karma points MVP 2x
    Nov 24, 2015 @ 09:37
    Shannon Deminick
    0

    Since this is a 0.9 version, much of the functionality might not be implemented.

    The easiest way right now to review how to do things is to look at the code:

    https://github.com/umbraco/UmbracoRestApi

    There's tests written for all Actions, for example:

    https://github.com/umbraco/UmbracoRestApi/blob/master/src/Umbraco.RestApi.Tests/ContentControllerTests.cs

    This is the base controller for all controllers:

    https://github.com/umbraco/UmbracoRestApi/blob/master/src/Umbraco.RestApi/Controllers/UmbracoHalController.cs

    You can see there how DELETE should work when it's overridden, it's based on an ID. However, the content/media controller's don't have this implemented yet IIRC, though Members and Relations do.

    POST = update, you just send the same json structure as you have for a single item. You can also look at the 'metadata' structure (i.e. GetMetadata method) to see how the json is formatted for saving if you felt the need to create this manually.

    PUT = create, it's basically the same as POST without an Id.

    The endpoints for both are the same as the GET endpoint just using a different http method.

    There are tests you can review for their functionality.

    We would be delighted for any help regarding the REST API, implementing DELETE methods would be super easy, you could basically follow the same principles as the Member controller.

    I've created an issue for this: https://github.com/umbraco/UmbracoRestApi/issues/11

  • Alexander Brückner 8 posts 75 karma points
    Nov 24, 2015 @ 09:47
    Alexander Brückner
    0

    Thank you very much for the quick Answer! I think that helps us further.

  • Antonios Fesenmeier 4 posts 75 karma points
    Nov 26, 2015 @ 14:10
    Antonios Fesenmeier
    1

    Hey pals,

    thank's for your answers.

    We've got our PUT/POST/DELTE requests running! Also the document upload is working. I hope you guys are still working at your REST API and documentation in the future, i think this would be amazing for a lot of people out there ;).

    At the moment it's quite hard to use umbraco (java) without sniffing the calls from the UI and some code analysis.

    Greetings Toni

  • Alexander Brückner 8 posts 75 karma points
    Nov 27, 2015 @ 08:00
    Alexander Brückner
    0

    Hey Toni,

    that sounds good! Maybe you can share your findings with the community?

    That would be awesome!

    Greetings Alex

Please Sign in or register to post replies

Write your reply to:

Draft