Reviewers

Note

These APIs are experimental and are currently being worked on. Endpoints may change without warning. Consider the v3 API if you need stability. The only authentication method available at the moment is the internal one.

Subscribe

This endpoint allows you to subscribe the current user to the notification sent when a new listed version is submitted on a particular add-on.

Note

Requires authentication and the current user to have any reviewer-related permission.

POST /api/v4/reviewers/addon/(int: addon_id)/subscribe/

Unsubscribe

This endpoint allows you to unsubscribe the current user to the notification sent when a new listed version is submitted on a particular add-on.

Note

Requires authentication and the current user to have any reviewer-related permission.

POST /api/v4/reviewers/addon/(int: addon_id)/unsubscribe/

Disable

This endpoint allows you to disable the public listing for an add-on.

Note

Requires authentication and the current user to have Reviews:Admin

permission.

POST /api/v4/reviewers/addon/(int: addon_id)/disable/

Enable

This endpoint allows you to re-enable the public listing for an add-on. If the add-on can’t be public because it does not have public versions, it will instead be changed to awaiting review or incomplete depending on the status of its versions.

Note

Requires authentication and the current user to have Reviews:Admin permission.

POST /api/v4/reviewers/addon/(int: addon_id)/enable/

Flags

This endpoint allows you to manipulate various reviewer-specific flags on an add-on.

Note

Requires authentication and the current user to have Reviews:Admin permission.

PATCH /api/v4/reviewers/addon/(int: addon_id)/flags/
Response JSON Object
  • auto_approval_disabled (boolean) – Boolean indicating whether auto approval are disabled on an add-on or not. When it’s true, new versions for this add-on will make it appear in the regular reviewer queues instead of being auto-approved.

  • pending_info_request (string|null) – Deadline date for the pending info request as a string, or null.

  • needs_admin_code_review (boolean) – Boolean indicating whether the add-on needs its code to be reviewed by an admin or not.

  • needs_admin_content_review (boolean) – Boolean indicating whether the add-on needs its content to be reviewed by an admin or not.

List Versions

This endpoint allows you to list versions that can be used either for browsing or diffing versions.

Note

Requires authentication and the current user to have ReviewerTools:View permission for listed add-ons as well as Addons:ReviewUnlisted for unlisted add-ons. Additionally the current user can also be the owner of the add-on.

If the user doesn’t have AddonsReviewUnlisted permissions only listed versions are shown. Otherwise it can contain mixed listed and unlisted versions.

GET /api/v4/reviewers/addon/(int: addon_id)/versions/
Response JSON Object
  • id (int) – The version id.

  • channel (string) – The version channel, which determines its visibility on the site. Can be either unlisted or listed.

  • version (string) – The version number string for the version.

Browse

This endpoint allows you to browse through the contents of an Add-on version.

Note

Requires authentication and the current user to have ReviewerTools:View permission for listed add-ons as well as Addons:ReviewUnlisted for unlisted add-ons. Additionally the current user can also be the owner of the add-on.

GET /api/v4/reviewers/addon/(int: addon_id)/versions/(int: version_id)/

Inherits most properties from version detail except files.

Parameters
  • file – The specific file in the XPI to retrieve. Defaults to manifest.json, install.rdf or package.json for Add-ons as well as the XML file for search engines.

Response JSON Object
  • validation_url_json (string) – The absolute url to the addons-linter validation report, rendered as JSON.

  • validation_url (string) – The absolute url to the addons-linter validation report, rendered as HTML.

  • has_been_validated (boolean) – True if the version has been validated through addons-linter.

  • addon (object) – A simplified add-on object that contains only a few properties: id, name, icon_url and slug.

  • file (object) – The file attached to this version. See version detail -> files[] for more details.

  • file.content (string) – Raw content of the requested file.

  • file.selected_file (string) – The selected file, either from the file parameter or the default (manifest.json, install.rdf or package.json for Add-ons as well as the XML file for search engines).

  • file.download_url (string|null) – The download url of the selected file or null in case of a directory.

  • file.entries[] (array) – The complete file-tree of the extracted XPI.

  • file.entries[].depth (int) – Level of folder-tree depth, starting with 0.

  • file.entries[].filename (string) – The filename of the file.

  • file.entries[].path (string) – The absolute path (from the root of the XPI) of the file.

  • file.entries[].sha256 (string) – SHA256 hash.

  • file.entries[].mimetype (string) – The determined mimetype of the file or application/octet-stream if none could be determined.

  • files.entries[].mime_category (string) – The mime type category of this file. Can be image, directory, text or binary.

  • file.entries[].size (int) – The size in bytes.

  • file.entries[].modified (string) – The exact time of the commit, should be equivalent with created.

Compare

This endpoint allows you to compare two Add-on versions with each other.

Note

Requires authentication and the current user to have ReviewerTools:View permission for listed add-ons as well as Addons:ReviewUnlisted for unlisted add-ons. Additionally the current user can also be the owner of the add-on.

GET /api/v4/reviewers/addon/(int: addon_id)/versions/(int: version_id)/compare_to/(int: version_id)/

Inherits most properties from browse detail, except that most of the file.entries[] properties can be null in case of a deleted file.

Properties specific to this endpoint:

Response JSON Object
  • file.entries[] (array) – The complete file-tree of the extracted XPI.

  • files.entries[].status (string) – Status of this file, see https://git-scm.com/docs/git-status#_short_format

  • file.entries[].depth (int|null) – Level of folder-tree depth, starting with 0.

  • file.entries[].filename (string) – The filename of the file.

  • file.entries[].path (string) – The absolute path (from the root of the XPI) of the file.

  • file.entries[].sha256 (string|null) – SHA256 hash.

  • file.entries[].mimetype (string|null) – The determined mimetype of the file or application/octet-stream if none could be determined. Can be null in case of a deleted file.

  • files.entries[].mime_category (string|null) – The mime type category of this file. Can be image, directory, text or binary.

  • file.entries[].size (int|null) – The size in bytes.

  • file.entries[].modified (string|null) – The exact time of the commit, should be equivalent with created.

  • diff (object) – See the following output with inline comments for a complete description.

Git patch we’re talking about:

diff --git a/README.md b/README.md
index a37979d..b12683c 100644
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-# beastify
+Updated readme
diff --git a/manifest.json b/manifest.json
index aba695f..24f385f 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,36 +1 @@
-{
-
-  "manifest_version": 2,
-  "name": "Beastify",
-  "version": "1.0",
-
-  "permissions": [
-    "http://*/*",
-    "https://*/*",
-    "bookmarks",
-    "made up permission",
-    "https://google.com/"
-  ],
-
-  "content_scripts": [
-  {
-    "matches": ["*://*.mozilla.org/*"],
-    "js": ["borderify.js"]
-  },
-  {
-    "matches": ["*://*.mozilla.com/*", "https://*.mozillians.org/*"],
-    "js": ["borderify.js"]
-  }
-  ],
-
-  "browser_action": {
-    "default_icon": "button/beasts.png",
-    "default_title": "Beastify",
-    "default_popup": "popup/choose_beast.html"
-  },
-
-  "web_accessible_resources": [
-    "beasts/*.jpg"
-  ]
-
-}
+{"id": "random"}

The following represents the git patch from above.

"diff": [
    {
        "path": "README.md",
        "old_path": "README.md",
        "size": 15,  // Size in bytes
        "lines_added": 1,  // How many lines got added
        "lines_deleted": 1,  // How many lines got deleted
        "is_binary": false,  // Is this a binary file (as determined by git)
        "mode": "M",  // Status of this file, see https://git-scm.com/docs/git-status#_short_format
        "hunks": [
            {
                "header": "@@ -1 +1 @@\\n",
                "old_start": 1,
                "new_start": 1,
                "old_lines": 1,
                "new_lines": 1,
                "changes": [
                    {
                        "content": "# beastify\\n",
                        "type": "delete",
                        "old_line_number": 1,
                        "new_line_number": -1
                    },
                    {
                        "content": "Updated readme\\n",
                        "type": "insert",
                        "old_line_number": -1,
                        "new_line_number": 1
                    }
                ]
            }
        ],
        "parent": "075c5755198be472522477a1b396951b3b68ac18",
        "hash": "00161dcf22afb7bab23cf205f0c903eb5aad5431"
    }
]

Download

This endpoint allows you to download files from an Add-on.

Note

Requires authentication and the current user to have ReviewerTools:View permission for listed add-ons as well as Addons:ReviewUnlisted for unlisted add-ons. Additionally the current user can also be the owner of the add-on.

GET /api/v4/reviewers/addon/(int: addon_id)/versions/(int: version_id)/download/(str: filename)/

This will return a streaming response serving the file.

Content-Type, Content-Disposition and Content-Length are correctly set.