Comment 0 for bug 690551

Revision history for this message
Michael Nelson (michael.nelson) wrote :

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/

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.