Closed Bug 975908 Opened 10 years ago Closed 10 years ago

204 when trying to add content ratings to an app via the API

Categories

(Marketplace Graveyard :: API, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
2014-03-04

People

(Reporter: bsilverberg, Assigned: kngo)

References

Details

(Whiteboard: [fromAutomation][qa-])

I am working on bug 975071 and have found that when I do a post to:

https://marketplace-dev.allizom.org:443/api/v1/apps/app/483843/content_ratings/

where 483843 is a valid app id, and I am using what I believe to be a valid submission_id and security_code, I get a 204 response and the content rating is not added, whereas a 201 response is expected. Unfortunately, as it is returning a 204, there is nothing else in the response that explains why that is happening (there is no content / message).

It is possible my submission id and code are not valid, and if that would result in a 204 please let me know. I can tell you that when using a different submission_id and security_code which are invalid I do receive a 400 response which tells me that the submission_id is invalid, so I think that is not what is happening here, but I am not sure.

Mat, would you be able to look into this for me?
Flags: needinfo?(mpillard)
Whether correct or not, the code [1] says to return a 204 rather than a 201 on a successful submission.

- Bob, can you check the app [2] after receiving a 204 to see if the content ratings have been accepted and attached as expected?
- Either a 201 with the full serialization of the Webapp or the ContentRating object would be most consistent with the rest of the API. CCing the two developers who worked on content ratings for their thoughts.

[1] https://github.com/mozilla/zamboni/blob/master/mkt/webapps/api.py#L499
[2] http://firefox-marketplace-api.readthedocs.org/en/latest/topics/apps.html#get--api-v1-apps-app-%28int-id%29|%28string-slug%29-
Flags: needinfo?(mpillard)
Thanks for the reply, Chuck. Now that I know that the 204 is expected, I checked again and yes, it is adding the content rating to the app.

I guess this is another thing that should be updated in the docs. Either that, or change the response code as you suggest above.
Assignee: nobody → kngo
Blocks: 929812
Target Milestone: --- → 2014-02-25
https://github.com/mozilla/zamboni/pull/1801
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: 2014-02-25 → 2014-03-04
Can you please add some STRs to this bug or mark it as [qa-]?
Whiteboard: [fromAutomation] → [fromAutomation][qa-]
You need to log in before you can comment on or make changes to this bug.