Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6675781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:54:09+00:00 2026-05-26T03:54:09+00:00

I am still trying to wrap my head around certain cases in REST where

  • 0

I am still trying to wrap my head around certain cases in REST where using resources defined by names instead of verbs is less intuitive than in simple CRUD cases.

I have an “Update” resource, for updates/addons of the backend, with a Json representation as follows:

{
  "id": 1,
  "name": "Update Example",      
  "description": "demo update , adds handling of basic arduio type devices",
  "version": "0.0.4",
  "link": 
  {
     "rel": "self",
     "uri": "http://demo.org/updates/1",
     "type: application/json"
  },
 }

EDIT:
To clarify things a bit following Darrel Miller’s answer: an updates “Updates” collection resource is already in place and it works like this:

  • The back-end populates that collection based on a list of updates fetched (via polling) from an external server (that does not use rest, the update descriptions there are minimal, and pure text)
  • The user using the API cannot add updates, all he can do is get the updates list, and install/ uninstall them

Now the problem is this:

I need to find a proper, restfull way to install updates via the API, and I came up with a few ways to do this, but they all seem “not quite right” to me:


1- Add a link to the Update resource, add an Installation resource and make use of hateoas

Add this to the update:

   "link": 
      {
         "rel": "Installation",
         "uri": "http://demo.org/updates/1/installation",
         "type: "application/json"
      }

Installation resource :

  {
       "installing": false,
       "installProgress": 0,
       "link": 
       {
         "rel": "self",
         "uri": "http://demo.org/updates/1/installation",
         "type: "application/json"
       }
     }

To start the installation process the user would then POST to demo.org/updates/1/installation to update "installing": false to "installing": true

This seems like it would work but is it good practice to add the “installing” as a simple boolean attribute?


2- POST to a uri like demo.org/installations , to add a new Installation resource

Thereby starting the install process, and also requiring the addition of a link to the update being downloaded inside the newly created Installation resource :

 {
   "installProgress": 0,
   "link": 
    {
       "rel": "update",
       "uri": "http://demo.org/updates/1",
        "type: application/json"
    },
   }

While this may centralize the Installation resource logically into an Installations collections, my original reflex would have been to DELETE an item in this collection to stop its installation .

In that case if the Installation resource instance is gone , would the use of the “installation” link on the update have to recreate a new installation resource every time it is “navigated” ?

More generally, would it not be better to have an “installed” attribute in the Update itself to make sense overall ?

Also what if the user wants to pause something like an installation ?


I have looked at a lot of similar questions in various articles and here on stackoverflow, but i still am not quite sure what the best way to tackle these kinds of problems is.
Also , I know REST is not about verbs (beyond the HTTP ones) but I still believe this is a valid question.

So please, any feedback is very welcome !

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:54:10+00:00Added an answer on May 26, 2026 at 3:54 am

    How about if you POST to an “Updates” collection resource. That would return a 202 with a Location link to a “Installation” resource that is transient. When the installation finishes it would contain a link to the deployed “update” resource. At some point you can garbage collection the installation resources.

    So for me, intuitively you would add an update to the updates collection and if you wanted to see previously installed updates you could GET this collection. Operations that are available purely during the installation process, like pause and cancel, they can be made available as links in the “installation” resource.


    Update:

    Ok, so if the user cannot POST to /updates then another approach is to create a processing resource called “Installer”.

    POST /Installer
    201 Created
    Location: /Installation/345
    

    The pause and cancel terms are what I would use for the rel. Nobody should give you a hard time for that. What URI you use for those rels is a bit more tricky. Cancel could definitely be done by deleting the installation resource. Maybe you could do pause by doing a PUT to /installation/345/status.

    To implement those additional actions will almost certainly require creating some other kind of resource/sub-resource. That’s fine. In my opinion you should never hesitate to create a new resource if it is a simple solution to your problem. We only have the HTTP methods to work with so modelling complex behaviour requires us to get creative with new resources.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still trying to wrap my head around using NSDictionaries, and have come into
I'm still trying to wrap my head around using JQuery's Deferred objects, and am
I'm still trying to wrap my head around how things should be done in
Probably a stupid question but I'm still trying to wrap my head around nHibernate.
I'm still trying to wrap my head around iphone memory management. I have checked
I'm still trying to wrap my head around zones, widgets, and layers so please
I'm still trying to wrap my head around how F# generalizes (or not) functions
I'm still very new to prolog, and am trying to wrap my head around
I'm VERY new to WPF, and still trying to wrap my head around binding
Still trying to wrap my head around Clojure. I can see how to implement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.