Improvements to restful API

Bug #690551 reported by Michael Nelson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ratings and Reviews server
Fix Released
Medium
Michael Nelson

Bug Description

Looking at the /api/urls.py that we have, I think there are a few improvements we could make before releasing it (and supporting the api in the future):

1) Remove unnecessary verbs from url, eg 1.0/reviews/create/

This could instead be a POST action on 1.0/reviews/

and return the new resource, rather than "Created".

2) Namespacing models, eg. 1.0/<review_id>/report-review/ has no namespace (ie. the model is ambiguous, and if later we wanted to represent moderations or other models in the api we'd have to be inconsistent).

I think this url should be namespaced, and also remove the verb, instead POSTing to 1.0/reviews/<review_id>/flags/

Similarly, creating a 'useful' recommendation for a review would be a POST to 1.0/reviews/<review_id>/recommendations/ (note plurals).

See http://en.wikipedia.org/wiki/REST#RESTful_web_services for standard restful webservice uris.

To QA:
Since this is just a change to the API, this is QA-OK if the functionality using the api still works :). ie. reviews can be created, flagged and marked as useful.

description: updated
Changed in rnr-server:
status: New → In Progress
assignee: nobody → Michael Nelson (michael.nelson)
description: updated
Changed in rnr-server:
status: In Progress → Fix Committed
tags: added: kb-improvement
Revision history for this message
Dave Morley (davmor2) wrote :

I can't see a way to trigger the marked as useful via SC so am assuming this can only be done via api calls presently

Revision history for this message
Dave Morley (davmor2) wrote :

This is now passed thanks to Anthony for the docs.

Changed in rnr-server:
importance: Undecided → Medium
Changed in rnr-server:
status: Fix Committed → Fix Released
Changed in rnr-server:
milestone: none → 10.12
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.