wiki:NDG3/Vocab/RestfulRoy

Version 1 (modified by lawrence, 11 years ago) (diff)

Roy's Proposal

So, what is a sensible API for an editor? My thinking is that an editor cares about two things – updatable_lists (i.e. complete vocabularies that may be edited) and update_sets (items from a list that are to be added, deleted or modifications to existing items)

My uri space would look like

  1. Updatable_lists
    • vocab.ndg.nerc.ac.uk/updatable_lists
      • GET is the only supported method, which returns the URIs of the lists that may be edited by the currently authenticated user. Acceptable responses:
        • 200 OK
        • 204 No lists for authenticated user
        • ??? No user authenticated
      • POST, PUT, DELETE not supported.
        • 405 Method not allowed.
    • vocab.ndg.nerc.ac.uk/updatable_lists/listID
      • GET returns the specified list. Acceptable responses:
        • 200 OK
        • 404 Not Found (not a valid list).
        • ??? User not authorised to update the specified list
        • ??? No user authenticated
      • PUT provides a completely new version of the list. (Not to be supported in first version of the software)
        • At this version: respond with a 405 Method not allowed.
      • POST, DELETE not supported.
        • 405 Method not allowed.
  2. Update sets
    • vocab.ndg.nerc.ac.uk/update_set/listID manages updates for a specified list. Document payload may include insertions, changes and deletions as XML elements.
      • GET returns the pending updates for the specified list. Acceptable Responses:
        • 200 OK
        • 204 No content for that list
        • 404 Not a valid list
        • ??? Not authorised – user cannot change specified list
        • ??? No user authenticated
      • POST provides a fresh set of pending updates. Acceptable responses:
        • 200 OK
        • ??? change for item included in set already pending
        • ??? Not authorised – user cannot change specified list
        • ??? No user authenticated
      • PUT replaces an existing set of pending updates. Acceptable responses
        • 200 OK
        • ??? no update for specified list pending
        • ??? Not authorised – user cannot change specified list
        • ??? No user authenticated
      • DELETE not allowed, return 405