Reviewers

Note

These v4 APIs are now frozen. See the API versions available for details of the different API versions available. 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 version is submitted on a particular add-on.

Note

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

Note

.../subscribe/ uses the listed channel implicitly. This endpoint is deprecated, use the explicit channel endpoints.

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

Unsubscribe

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

Note

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

Note

.../unsubscribe/ uses the listed channel implicitly. This endpoint is deprecated, use the explicit channel endpoints.

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

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.

  • auto_approval_disabled_until_next_approval (boolean) – Boolean indicating whether auto approval are disabled on an add-on until the next version is approved or not. Has the same effect as auto_approval_disabled but is automatically reset to false when the latest version of the add-on is manually approved by a human reviewer.

  • auto_approval_delayed_until (string|null) – Date until the add-on auto-approval is delayed.

  • 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.

  • needs_admin_theme_review (boolean) – Boolean indicating whether the theme needs to be reviewed by an admin or not.

Allow resubmission

This endpoint allows you to allow resubmission of an add-on that was previously denied.

Note

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

POST /api/v4/reviewers/addon/(int: addon_id)/allow_resubmission/
Status Codes:

Deny resubmission

This endpoint allows you to deny resubmission of an add-on that was not already denied.

Note

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

POST /api/v4/reviewers/addon/(int: addon_id)/deny_resubmission/
Status Codes:

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.

This endpoint is not paginated as normal, and instead will return all results without obeying regular pagination parameters.

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 the following properties from version detail: id, channel, reviewed and version.

Parameters:
  • file (string) – 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.

  • file_only (boolean) – Indicates that the API should only return data for the requested file, and not version data. If this is true then the only property returned of those listed below is the file property.

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_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[].mime_category (string) – The mime type category of this file. Can be image, directory, text or binary.

  • file (object) – The requested file.

  • file.id (int) – The id of the submitted file (i.e., the xpi file).

  • 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.mimetype (string) – The determined mimetype of the selected file or application/octet-stream if none could be determined.

  • file.sha256 (string) – SHA256 hash of the selected file.

  • file.size (int) – The size of the selected file in bytes.

  • file.filename (string) – The filename of the file.

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

  • uses_unknown_minified_code (boolean) – Indicates that the selected file could be using minified code.

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: base_version_id)/compare_to/(int: version_id)/

Note

Contrary to what git diff does, this API renders a hunk full of unmodified lines for unmodified files.

Inherits most properties from browse detail, except that most of the file.entries[] properties and file.download_url 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.

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

  • 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[].mime_category (string) – The mime type category of this file. Can be image, directory, text or binary.

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

  • base_file (object) – The file attached to the base version you’re comparing against.

  • base_file.id (object) – The id of the base file.

  • uses_unknown_minified_code (boolean) – Indicates that the selected file in either the current or the parent version could be using minified code.

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"
}

Canned Responses

This endpoint allows you to retrieve a list of canned responses.

Note

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

GET /api/v4/reviewers/canned-responses/

Retrieve canned responses

Note

Because this endpoint is not returning too much data it is not paginated as normal, and instead will return all results without obeying regular pagination parameters.

Response JSON Object:
  • id (int) – The canned response id.

  • title (string) – The title of the canned response.

  • response (string) – The text that will be filled in as the response.

  • category (string) – The category of the canned response. For example, “Other”, “Privacy reasons” etc.

Drafting Comments

These endpoints allow you to draft comments that can be submitted through the regular reviewer pages.

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)/draft_comments/

Retrieve existing draft comments for a specific version. See pagination for more details.

Response JSON Object:
  • count (int) – The number of comments for this version.

  • next (string) – The URL of the next page of results.

  • previous (string) – The URL of the previous page of results.

  • results (array) – An array of comments.

GET /api/v4/reviewers/addon/(int: addon_id)/versions/(int: version_id)/draft_comments/(int: comment_id)/
Response JSON Object:
  • id (int) – The id of the draft comment object.

  • comment (string) – The comment that is being drafted as part of a review. Specific to a line in a file.

  • filename (string|null) – The full file path a specific comment is related to. Can be null in case a comment doesn’t belong to a specific file but the whole version.

  • lineno (int|null) – The line number a specific comment is related to. Please make sure that in case of comments for git diffs, that the lineno used here belongs to the file in the version that belongs to version_id and not it’s parent. Can be null in case a comment belongs to the whole file and not to a specific line.

  • version_id (int) – The id of the version.

  • user.id (int) – The id for an author.

  • user.name (string) – The name for an author.

  • user.username (string) – The username for an author.

  • user.url (string|null) – The link to the profile page for an author, if the author’s profile is public.

  • canned_response (object|null) – Object holding the canned response if set.

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

Create a draft comment for a specific version.

Request JSON Object:
  • comment (string) – The comment that is being drafted as part of a review.

  • filename (string) – The full file path this comment is related to. This must represent the full path, including sub-folders and relative to the root. E.g lib/scripts/background.js

  • lineno (int) – The line number this comment is related to (optional). Please make sure that in case of comments for git diffs, that the lineno used here belongs to the file in the version that belongs to version_id and not it’s parent.

  • canned_response (int) – The id of the canned response (optional).

Status Codes:
  • 201 Created – New comment has been created.

  • 400 Bad Request – An error occurred, check the error value in the JSON.

  • 403 Forbidden – The user doesn’t have the permission to create a comment. This might happen (among other cases) when someone without permissions for unlisted versions tries to add a comment for an unlisted version (which shouldn’t happen as the user doesn’t see unlisted versions, but it’s blocked here too).

Response

In case of successful creation, the response is a draft comment object.

DELETE /api/v4/reviewers/addon/(int: addon_id)/versions/(int: version_id)/draft_comments/(int: comment_id)/

Delete a draft comment.

Status Codes:
  • 204 No Content – The comment has been deleted successfully.

  • 404 Not Found – The user doesn’t have the permission to delete. This might happen when someone tries to delete a comment created by another reviewer or author.

PATCH /api/v4/reviewers/addon/(int: addon_id)/versions/(int: version_id)/draft_comments/(int: comment_id)

Update a comment, it’s filename or line number.

Request JSON Object:
  • comment (string) – The comment that is being drafted as part of a review.

  • filename (string) – The full file path this comment is related to. This must represent the full path, including sub-folders and relative to the root. E.g lib/scripts/background.js

  • lineno (int) – The line number this comment is related to. Please make sure that in case of comments for git diffs, that the lineno used here belongs to the file in the version that belongs to version_id and not it’s parent.

  • canned_response (int) – The id of the canned response (optional).

Status Codes:
  • 200 OK – The comment has been updated.

  • 400 Bad Request – An error occurred, check the error value in the JSON.

Response

In case of successful creation, the response is a draft comment object.