Uploads

Formats

We support all common localization file formats. For a detailed overview, see our Format Guide.

Processing

Uploads will be processed asynchronously and thus the data might not be imported yet although the upload is completed. Therefore we recommend to evaluate the returned state field for information on the import progress.

Available States

State Description
initialized Data received.
waiting Upload is waiting for processing.
processing Upload is being processed, data is currently imported.
success Upload is complete and all data is imported.
error Upload or import process failed.

POST /v2/projects/:project_id/uploads

Upload a new language file. Creates necessary resources in your project.

Parameters

Name Type Description
file file File to be imported
file_format
optional
string File format. Auto-detected when possible and not specified.
locale_id
optional
id Locale of the file's content. Can be the name or public id of the locale. Preferred is the public id.
tags
optional
string List of tags separated by comma to be associated with the new keys contained in the upload.
update_translations
optional
boolean Indicates whether existing translations should be updated with the file content.
Default: false
update_descriptions
optional
boolean Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
Default: false
convert_emoji
optional
boolean Indicates whether the file contains Emoji symbols that should be converted. Working with Emojis.
Default: false
skip_upload_tags
optional
boolean Indicates whether the upload should not create upload tags.
Default: false
skip_unverification
optional
boolean Indicates whether the upload should unverify updated translations.
Default: false
file_encoding
optional
string Enforces a specific encoding on the file contents. Valid options are "UTF-8", "UTF-16" and "ISO-8859-1".
format_options
optional
hash Additional options available for specific formats. See our format guide for complete list.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/uploads" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST \
  -F file=@/path/to/my/file.json \
  -F file_format=json \
  -F locale_id=abcd1234cdef1234abcd1234cdef1234 \
  -F tags=awesome-feature,needs-proofreading \
  -F format_options=%7B%22foo%22:%20%22bar%22%7D
phraseapp upload create <project_id> \
--file /path/to/my/file.json \
--file-format json \
--locale-id abcd1234cdef1234abcd1234cdef1234 \
--tags awesome-feature,needs-proofreading \
--format-options "{"foo": "bar"}"

Response

Status: 201
{ "id": "abcd1234cdef1234abcd1234cdef1234", "filename": "example.json", "format": "json", "state": "success", "summary": { "locales_created": 2, "translation_keys_created": 162, "translations_created": 291, "translations_updated": 3, "tags_created": 2 }, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }

GET /v2/projects/:project_id/uploads/:id

View details and summary for a single upload.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/uploads/:id" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp upload show <project_id> <id>

Response

Status: 200
{ "id": "abcd1234cdef1234abcd1234cdef1234", "filename": "example.json", "format": "json", "state": "success", "summary": { "locales_created": 2, "translation_keys_created": 162, "translations_created": 291, "translations_updated": 3, "tags_created": 2 }, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }

GET /v2/projects/:project_id/uploads

List all uploads for the given project.

This endpoint is paginated.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/uploads" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp uploads list <project_id>

Response

Status: 200
[ { "id": "abcd1234cdef1234abcd1234cdef1234", "filename": "example.json", "format": "json", "state": "success", "summary": { "locales_created": 2, "translation_keys_created": 162, "translations_created": 291, "translations_updated": 3, "tags_created": 2 }, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }, { "id": "abcd1234cdef1234abcd1234cdef1234", "filename": "example.json", "format": "json", "state": "success", "summary": { "locales_created": 2, "translation_keys_created": 162, "translations_created": 291, "translations_updated": 3, "tags_created": 2 }, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ]