New in version 2.
Firefox OS Add-ons¶
Warning
Firefox OS Add-ons in Marketplace are experimental and not yet available in production. This API is not ready for public consumption yet and can change at any moment.
The two main resources that are manipulated through this API are Add-ons and Add-ons Versions.
Add-on¶
Detail¶
-
GET
/api/v2/extensions/extension/
(int: id)|
(string: slug)/
¶ Note
Non public add-ons can only be viewed by their authors or extension reviewers (users with the ContentTools:AddonReview permission)
A single add-on.
Example Response:
{ "id": 1, "author": "Mozilla", "description": null, "disabled": false, "device_types": ["firefoxos"], "icons": { "64": "https://example.com/uploads/extensions_icons/0/1-64.png?m=1a1337", "128": "https://example.com/uploads/extensions_icons/0/1-128.png?m=1a1337", } "latest_version": { "id": 1, "download_url": "https://example.com/downloads/extension/ce6b52d231154a27a1c54b2648c10379/1/extension-0.1.zip", "unsigned_download_url": "https://example.com/downloads/extension/unsigned/ce6b52d231154a27a1c54b2648c10379/1/extension-0.1.zip", "status": "public", "version": "0.1" }, "last_updated": "2015-09-04T16:16:39", "latest_public_version": { "id": 1, "download_url": "https://example.com/downloads/extension/ce6b52d231154a27a1c54b2648c10379/1/extension-0.1.zip", "unsigned_download_url": "https://example.com/downloads/extension/unsigned/ce6b52d231154a27a1c54b2648c10379/1/extension-0.1.zip", "status": "public", "version": "0.1" }, "mini_manifest_url": "https://example.com/extension/ce6b52d231154a27a1c54b2648c10379/manifest.json", "name": { "en-US": "My Lîttle Extension" }, "slug": "my-lîttle-extension", "status": "public", "uuid": "be98056d6963461eb543bea2ddf3b9af" }
Note
The
name
anddescription
fields are user-translated fields and have a dynamic type depending on the query. See translations.Response JSON Object: - id (int) – The add-on id.
- author (string) – The add-on author, if specified in the manifest.
- description (string|object|null) – The add-on description.
- disabled (boolean) – Boolean indicating whether the developer has disabled their add-on or not.
- device_types (string) – The devices the add-on is compatible with.
- icons (object) – An object containing information about the app icons. The keys represent icon sizes, the values the corresponding URLs.
- last_updated (string|null) – The latest date a version was published at for this add-on.
- latest_version (object) – The latest add-on version available for this extension.
- latest_public_version (object) – The latest public add-on version available for this extension.
- mini_manifest_url (string) – The (absolute) URL to the mini-manifest for that add-on. That URL may be a 404 if the add-on is not public yet.
- name (string|object) – The add-on name.
- slug (string) – The add-on slug (unique string identifier that can be used instead of the id to retrieve an add-on).
- status (string) – The add-on current status. Can be incomplete, pending, or public.
- uuid (string) – The add-on uuid, used internally for URLs and for blocklisting.
Parameters: - id (int) – The add-on id
- slug (string) – The add-on slug
Status Codes: - 200 OK – successfully completed.
- 403 Forbidden – not allowed to access this object.
- 404 Not Found – not found.
List¶
-
GET
/api/v2/extensions/extension/
¶ Note
Requires authentication.
A list of add-ons you have submitted.
Response JSON Object: - meta (object) – Listing response meta.
- objects (array) – An array of add-ons.
Status Codes: - 200 OK – successfully completed.
- 403 Forbidden – not authenticated.
Update¶
-
PATCH
/api/v2/extensions/extension/
(int: id)|
(string: slug)/
¶ Note
Requires authentication and ownership of the Add-on.
Update some properties of an add-on.
Parameters: - id (int) – The add-on id
- slug (string) – The add-on slug.
Request JSON Object: - disabled (boolean) – Boolean indicating whether the developer has disabled their add-on or not.
- slug (string) – The add-on slug (unique string identifier that can be used instead of the id to retrieve an add-on).
Status Codes: - 200 OK – successfully completed.
- 403 Forbidden – not allowed to access this object.
- 404 Not Found – not found.
Search¶
-
GET
/api/v2/extensions/search/
¶ Search through public add-ons.
All query parameters are optional. The default sort order when the sort parameter is absent depends on whether a search query (q) is present or not:
- If a search query is passed, order by relevance.
- If no search query is passed, order by popularity descending.
Parameters: - q (string) – The search query.
- author (string) – Filter by author. Requires a case-insensitive exact match of the author field.
- sort (string) – The field(s) to sort by. One or more of ‘popularity’, ‘created’, ‘name’, ‘reviewed’. In every case except ‘name’, sorting is done in descending order.
Response JSON Object: - meta (object) – Listing response meta.
- objects (array) – An array of add-ons.
Status Codes: - 200 OK – successfully completed.
Delete¶
-
DELETE
/api/v2/extensions/extension/
(int: id)|
(string: slug)/
¶ Note
Requires authentication. Only works on your own Add-ons.
Delete an add-on. This action is irreversible.
Blocking and Unblocking¶
-
POST
/api/v2/extensions/extension/
(int: id)|
(string: slug)/block/
¶ Note
Requires authentication and admin rights (Admin:%s permission).
Blocks an add-on.
When in this state the Extension should not be editable by the developers at all; not visible publicly; not searchable by users; but should be shown in the developer’s dashboard, as ‘Blocked’.
-
POST
/api/v2/extensions/extension/
(int: id)|
(string: slug)/unblock/
¶ Note
Requires authentication and admin rights (Admin:%s permission).
Unblocks an add-on. It should restore its status according to the rules below.
Add-on Versions¶
Detail¶
-
GET
/api/v2/extensions/extension/
(int: id)|
(string: slug)/versions/
(int: version_id)/
¶ Note
Non public add-ons versions can only be viewed by their authors or extension reviewers (users with the ContentTools:AddonReview permission)
A single add-on version.
Example Response:
{ "id": 1, "created": "2015-09-28T10:02:23", "download_url": "https://marketplace.firefox.com/downloads/extension/ce6b52d231154a27a1c54b2648c10379/42/extension-0.1.zip", "reviewer_mini_manifest_url": "https://marketplace.firefox.com/extension/reviewers/ce6b52d231154a27a1c54b2648c10379/42/manifest.json", "unsigned_download_url": "https://marketplace.firefox.com/downloads/extension/unsigned/ce6b52d231154a27a1c54b2648c10379/42/extension-0.1.zip", "status": "public", "version": "0.1" }
Response JSON Object: - created (string) – The creation date for this version.
- download_url (string) – The (absolute) URL to the latest signed package for that add-on. That URL may be a 404 if the add-on is not public.
- reviewer_mini_manifest_url (string) – The (absolute) URL to the reviewer-specific mini_manifest URL (allowing reviewers to install a non-public version) for this version. Only users with ContentTools:AddonReview permission may access it.
- status (string) – The add-on version current status. Can be pending, obsolete, public or rejected.
- unsigned_download_url (string) – The (absolute) URL to the latest unsigned package for that add-on. Only the add-on author or users with ContentTools:AddonReview permission may access it.
- version (string) – The version number for this add-on version.
Parameters: - id (int) – The add-on id
- slug (string) – The add-on slug
- version_id (int) – The add-on version id
Status Codes: - 200 OK – successfully completed.
- 403 Forbidden – not allowed to access this object.
- 404 Not Found – not found.
List¶
-
GET
/api/v2/extensions/extension/
(int: id)|
(string: slug)/versions/
¶ Note
Non public add-ons versions can only be viewed by their authors or extension reviewers (users with the ContentTools:AddonReview permission)
A list of versions attached to an add-on.
Response JSON Object: - meta (object) – Listing response meta.
- objects (array) – An array of add-ons versions.
Status Codes: - 200 OK – successfully completed.
- 403 Forbidden – not allowed.
- 404 Not Found – add-on not found.
Add-on Statuses¶
- There are 5 possible values for the
status
property of an add-on: public, pending, rejected, incomplete or blocked. - There are 4 possible values for the
status
property on an add-on version: public, obsolete, pending, rejected.
Add-on status
directly depend on the status
of its versions:
- Add-ons that are blocked never change.
- Add-ons with at least one public version are public.
- Add-ons with no public version and at least one pending version are pending.
- Add-ons with no public or pending version, and at least one rejected version are rejected.
- Add-ons with no public, pending or rejected version are incomplete.
Blocked Add-ons are hidden from the public. Reviewers and developers may still access them, but can not make any modifications to them, only admins can.
In addition, Add-ons also have a disabled
property that can be set to
true
by the developer to disable the add-on. Disabled add-ons are hidden
from the public and do not appear in the reviewers queue, but retain their
original status so they can be re-enabled by just switching disabled
back
to false
.
Add-on and Add-on Version Submission¶
Submitting an Add-on or an Add-on Version is done in two steps. The client must be logged in for all these steps and the user submitting the add-on or the add-on version must have accepted the terms of use.
- Validate your package. The validation will return a validation id.
- Post your add-on or your add-on version using the validation id obtained during the previous step. This will create an add-on or an add-on version and populate the data with the contents of the manifest.
Validation¶
Note
The validation API does not require you to be authenticated, however you cannot create add-ons from those unauthenticated validations. To validate and then submit an add-on you must be authenticated with the same account for both steps.
-
POST
/api/v2/extensions/validation/
¶ Validate your add-on. The zip file containting your add-on should be sent as the POST body directly. A validation result is returned.
Request Headers: - Content-Type – must to be set to
application/zip
- Content-Disposition – must be set to
form-data; name="binary_data"; filename="extension.zip"
Status Codes: - 201 Created – successfully created, processed.
- 202 Accepted – successfully created, still processing.
- 400 Bad Request – some errors were found in your add-on.
- Content-Type – must to be set to
-
GET
/api/v2/extensions/validation/
(string: id)/
¶ Response
A single validation result. You should poll this API until it returns a result with the
processed
property set totrue
before moving on with the submission process.Response JSON Object: - id (string) – the id of the validation.
- processed (boolean) – if the validation has been processed.
- valid (boolean) – if the validation passed.
- validation (string) – the resulting validation messages if it failed.
Status Codes: - 200 OK – successfully completed.
- 404 Not Found – validation not found.
Add-on Creation¶
-
POST
/api/v2/extensions/extension/
¶ Note
Requires authentication and a successful validation result.
Create an add-on. Note that an add-on version is created automatically for you. An add-on is returned. Icons are processed asynchronously; as a result, the json data returned might not contain the final URL for the icons at this time.
Request JSON Object: - validation_id (string) – the id of the validation result for your add-on.
- message (optional) (string) – Notes for reviewers about the submission.
Status Codes: - 201 Created – successfully created.
- 400 Bad Request – some errors were found in your add-on.
Add-on Version Creation¶
-
POST
/api/v2/extensions/extension/
(int: id)|
(string: slug)/versions/
¶ Note
Requires authentication, ownership of the add-on (which must not be in
disabled
state) and a successful validation result.Create an add-on version.
Request JSON Object: - validation_id (string) – the id of the validation result for your add-on version.
- message (optional) (string) – Notes for reviewers about the submission.
Parameters: - id (int) – The add-on id
- slug (string) – The add-on slug
Status Codes: - 201 Created – successfully created.
- 400 Bad Request – some errors were found in your add-on.
- 403 Forbidden – not allowed.
- 404 Not Found – add-on not found.
Add-ons Review Queue¶
Any add-on that is not disabled by its developer, and has at least one pending version is shown in the review queue, even if the add-on itself is currently public.
Add-ons are not directly published or rejected, Add-ons Versions are. Usually
the add-on latest_version
is the version that needs to be reviewed.
Once a version is published, rejected or deleted, the parent Add-on status
can change as described above.
List¶
-
GET
/api/v2/extensions/queue/
¶ Note
Requires authentication and the ContentTools:AddonReview permission.
The list of add-ons in the review queue.
Response JSON Object: - meta (object) – Listing response meta.
- objects (array) – An array of add-ons.
Status Codes: - 200 OK – successfully completed.
- 403 Forbidden – not allowed.
Publishing¶
-
POST
/api/v2/extensions/extension/
(int: id)|
(string: slug)/versions/
(int: id)/publish/
¶ Publish an add-on version. Its file will be signed, its status updated to public.
Parameters: - id (int) – The add-on id
- slug (string) – The add-on slug
- version_id (int) – The add-on version id
- message (optional) (string) – Reviewer notes about publishing
Status Codes: - 202 Accepted – successfully published.
- 403 Forbidden – not allowed to access this object or disabled add-on.
- 404 Not Found – add-on not found in the review queue.
Rejecting¶
-
POST
/api/v2/extensions/extension/
(int: id)|
(string: slug)/versions/
(int: id)/reject/
¶ Reject an add-on version. Its status will be updated to rejected. The developer will have to submit it a new version with the issues fixed.
Parameters: - id (int) – The add-on id
- slug (string) – The add-on slug
- version_id (int) – The add-on version id
- message (optional) (string) – Reviewer notes about rejecting
Status Codes: - 202 Accepted – successfully published.
- 403 Forbidden – not allowed to access this object or disabled add-on.
- 404 Not Found – add-on not found in the review queue.