User:LesOrchard/BandwagonAPI: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 166: Line 166:
** Content-Type: [[#Addon Collection]]
** Content-Type: [[#Addon Collection]]


===== POST - Add an addon to a collection or overwrite existing details =====
===== POST - Add an addon to a collection =====


* Request  
* Request  
Line 175: Line 175:


* Response (on success)  
* Response (on success)  
** Status: <tt>303 See Other</tt>
** Status: <tt>201 Created</tt>
** Content-Type: [[#Addon Collection]]
** Content-Type: empty document
** Response body will reflect the change to the collection with addon added or updated.
** Location header points to the URL of the addon resource in the collection.
** Location header points to the URL of collection, which will reflect the addition or update of the addon.
 
* Response (if addon already added)
** Status: 409 Conflict
** Content-Type: [[#Error Document]]


===== DELETE - Delete a collection =====
===== DELETE - Delete a collection =====
Line 224: Line 227:


=== Representations ===
=== Representations ===
==== Error Document ====
Most errors will be indicated by an HTTP Status in the 400s or 500s, and will
be accompanied by further details in an XML document like the following:
    <?xml version="1.0" encoding="utf-8" ?>
    <error xmlns="http://addons.mozilla.org/"
        reason="some_reason_for_error"
        details="further details for error" />
Reason values to expect include:
* <tt>invalid_parameters</tt>
* <tt>collection_unknown</tt>
* <tt>not_collection_owner</tt>
* <tt>unknown_addon_guid</tt>
* <tt>addon_already_in_collection</tt>
* <tt>addon_not_in_collection</tt>
* <tt>{GET,POST,DELETE,PUT}_not_allowed</tt>
* <tt>unauthorized</tt>


==== Service Document ====
==== Service Document ====
Line 262: Line 286:


==== Addon Collection ====
==== Addon Collection ====


     <?xml version="1.0" encoding="utf-8" ?>
     <?xml version="1.0" encoding="utf-8" ?>
Confirmed users
920

edits

Navigation menu