Marketplace/LangPacks

From MozillaWiki
< Marketplace
Revision as of 17:07, 16 February 2015 by Mat (talk | contribs) (Use stdin to pass data to curling (need 0.3.12))
Jump to navigation Jump to search

How to upload langpacks on Marketplace

Overview

API Example using curling

Setup

$ pip install curling
$ echo '{"marketplace.firefox.com": {"key": "<replace-by-your-api-key>", "secret": "<replace-by-your-api-secret>"}}' > ~/.curling

Validate a langpack

$ DATA=$( base64 -w 0 "/tmp/langpack.zip" )
$ curling -X POST -d '@-' https://marketplace.firefox.com/api/v2/apps/validation/ <<CURL_DATA
{"upload": {"type": "application/zip", "name": "langpack.zip", "data": "$DATA"}}
CURL_DATA

Check the validation result

$ curling https://marketplace.firefox.com/api/v2/apps/validation/<paste-validation-id-from-previous-line-here>/

Create a langpack from the validation result (once validation result says valid=true and processed=true)

$ curling -X POST -d '{"upload": "<paste-validation-id-from-previous-line-here>"}' https://marketplace.firefox.com/api/v2/langpacks/

Activate the langpack

Note: langpack uuid is different from the validation id, even though both are 32-chars hexadecimal strings.

$ curling -X PATCH -d '{"active": true}' https://marketplace.firefox.com/api/v2/langpacks/<paste-langpack-uuid-from-previous-line-here>/

Double-check that the langpack is now active

$ curling https://marketplace.firefox.com/api/v2/langpacks/<paste-langpack-uuid-from-previous-line-here>/

Updating an existing langpack

Validate a langpack like above, then:

$ curling -X PUT -d '{"upload": "<paste-validation-id-from-previous-line-here>"}' https://marketplace.firefox.com/api/v2/langpacks/<paste-langpack-uuid-here>/

Note: the version field in your manifest needs to be different.