Copied to clipboard

Flag this post as spam?

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

  • Ramon 7 posts 75 karma points
    Jun 07, 2019 @ 21:35

    WebApi RESTful CRUD urls

    I'm currently using Umbraco 7.x and trying to build out a simple API controller. I'm inheriting from UmbracoApiController and my controller is named MoviesController. I've created an action method called Index that returns a JsonResult

  • Jonathan Distenfeld 70 posts 403 karma points
    Jun 17, 2019 @ 07:07
    Jonathan Distenfeld

    Hi Ramon,

    I'm not sure what your question is, but have you tried reading the documentation?

    Maybe this will help:

    If this doesn't help, please specify your question.

    ~ Jonathan

  • Ramon 7 posts 75 karma points
    Jun 25, 2019 @ 14:47

    Hi Jonathan,

    Not sure why the rest of my paragraph got cut off, but basically I was asking if it's possible to have a more RESTful url for API routes (e.g. GET /umbraco/api/photos, GET /umbraco/api/photos/1, PUT /umbraco/api/photos, POST /umbraco/api/photos, DELETE /umbraco/api/photos/1), rather that having to include the action in the url (e.g. GET/umbraco/api/photos/index)? I've tried using the Route attribute like MSDN demonstrates, but then I get a 404. It seems Umbraco is requiring you to have the action method in the url.

Please Sign in or register to post replies

Write your reply to: