Source Files

Add File

Required scopes: project.source.file (Read and Write).

post/projects/{projectId}/files

Request

Path parameters

projectIdinteger required

Project Identifier. Get via List Projects

Request body

storageIdinteger required

Storage Identifier. Get via List Storages

namestring required

File name

Note: Can't contain \ / : * ? " < > | symbols. *

  • ZIP files are not allowed.
branchIdinteger

Branch Identifier — defines branch to which file will be added. Get via List Branches

Note: Can't be used with directoryId in same request

directoryIdinteger

Directory Identifier — defines directory to which file will be added. Get via List Directories

Note: Can't be used with branchId in same request

titlestring

Use to provide more details for translators. Title is available in UI only

contextstring

Use to provide context about whole file

type'auto' | 'android' | 'macosx' | 'resx' | 'properties' | 'gettext' | 'yaml' | 'php' | 'json' | 'xml' | 'ini' | 'rc' | 'resw' | 'resjson' | 'qtts' | 'joomla' | 'chrome' | 'dtd' | 'dklang' | 'flex' | 'nsh' | 'wxl' | 'xliff' | 'xliff_two' | 'html' | 'haml' | 'txt' | 'csv' | 'md' | 'mdx_v1' | 'mdx_v2' | 'flsnp' | 'fm_html' | 'fm_md' | 'mediawiki' | 'docx' | 'vsdx' | 'xlsx' | 'sbv' | 'properties_play' | 'properties_xml' | 'maxthon' | 'go_json' | 'dita' | 'idml' | 'mif' | 'stringsdict' | 'plist' | 'vtt' | 'vdf' | 'srt' | 'stf' | 'toml' | 'contentful_rt' | 'svg' | 'js' | 'coffee' | 'ts' | 'i18next_json' | 'xaml' | 'arb' | 'adoc' | 'fbt' | 'webxml' | 'nestjs_i18n' | 'loc'

Values available:

  • empty value or 'auto' — Try to detect file type by extension or MIME type
  • 'android' — Android (*.xml)
  • 'macosx' — Mac OS X / iOS (*.strings)
  • 'resx' — .NET, Windows Phone (*.resx)
  • 'properties' — Java (*.properties)
  • 'gettext' — GNU GetText (*.po, *.pot)
  • 'yaml' — Ruby On Rails (*.yaml, *.yml)
  • 'php' — Hypertext Preprocessor (*.php)
  • 'json' — Generic JSON (*.json)
  • 'xml' — Generic XML (*.xml)
  • 'ini' — Generic INI (*.ini)
  • 'rc' — Windows Resources (*.rc)
  • 'resw' — Windows 8 Metro (*.resw)
  • 'resjson' — Windows 8 Metro (*.resjson)
  • 'qtts' — Nokia Qt (*.ts)
  • 'joomla' — Joomla localizable resources (*.ini)
  • 'chrome' — Google Chrome Extension (*.json)
  • 'dtd' — Mozilla DTD (*.dtd)
  • 'dklang' — Delphi DKLang (*.dklang)
  • 'flex' — Flex (*.properties)
  • 'nsh' — NSIS Installer Resources (*.nsh)
  • 'wxl' — WiX Installer (*.wxl)
  • 'xliff' — XLIFF (*.xliff, *.xlf)
  • 'xliff_two' — XLIFF 2.0 (*.xliff, *.xlf)
  • 'html' — HTML (*.html, *.htm, *.xhtml, *.xhtm, *.xht, *.hbs, *.liquid)
  • 'haml' — Haml (*.haml)
  • 'txt' — Plain Text (*.txt)
  • 'csv' — Comma Separated Values (*.csv)
  • 'md' — Markdown (*.md, *.text, *.markdown...)
  • 'flsnp' — MadCap Flare (*.flnsp, .flpgpl .fltoc)
  • 'fm_html' — Jekyll HTML (*.html)
  • 'fm_md' — Jekyll Markdown (*.md)
  • 'mediawiki' — MediaWiki (*.wiki, *.wikitext, *.mediawiki)
  • 'docx' — Microsoft Office, OpenOffice.org Documents, Adobe InDesign, Adobe FrameMaker(*.docx, *.dotx, *.docm, *.dotm, *.xlsx, *.xltx, *.xlsm, *.xltm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm, *.odt, *.ods, *.odg, *.odp, *.imdl, *.mif)
  • 'vsdx' — Microsoft Visio (*.vsdx, *.vsdm)
  • 'xlsx' — Microsoft Excel (*.xlsx)
  • 'sbv' — Youtube .sbv (*.sbv)
  • 'properties_play' — Play Framework
  • 'properties_xml' — Java Application (*.xml)
  • 'maxthon' — Maxthon Browser (*.ini)
  • 'go_json' — Go (*.gotext.json)
  • 'dita' — DITA Document (*.dita, *.ditamap)
  • 'mif' — Adobe FrameMaker (*.mif)
  • 'idml' — Adobe InDesign (*.idml)
  • 'stringsdict' — iOS (*.stringsdict)
  • 'plist' — Mac OS property list (*.plist)
  • 'vtt' — Video Subtitling and WebVTT (*.vtt)
  • 'vdf' — Steamworks Localization Valve Data File (*.vdf)
  • 'srt' — SubRip .srt (*.srt)
  • 'stf' — Salesforce (*.stf)
  • 'toml' — Toml (*.toml)
  • 'contentful_rt' — Contentful (*.json)
  • 'svg' — SVG (*.svg)
  • 'js' — JavaScript (*.js)
  • 'coffee' — CoffeeScript (*.coffee)
  • 'nestjs_i18n' - NestJS i18n
  • 'loc' — LOC (*.loc)

Note: Use docx type to import each cell as a separate source string for XLSX file

parserVersioninteger

Using latest parser version by default.

Note: Must be used together with type

excludedTargetLanguagesstring[] nullable

Set Target Languages the file should not be translated into. Do not use this option if the file should be available for all project languages.

attachLabelIdsinteger[]

Attach labels to strings. Get via List Labels

fieldsEnterpriseAdditionalFields

Fields. Keys get via List Fields

Example request

{
  "storageId": 61,
  "name": "umbrella_app.xliff",
  "branchId": 34,
  "directoryId": 4,
  "title": "source_app_info",
  "context": "Additional context valuable for translators",
  "type": "xliff",
  "parserVersion": 1,
  "importOptions": {
    "importEqSuggestions": true,
    "autoApproveImported": true,
    "addToTm": true,
    "srxStorageId": 61,
    "importTranslations": true,
    "scheme": {
      "identifier": 0,
      "sourcePhrase": 1,
      "en": 2,
      "de": 3
    }
  },
  "excludedTargetLanguages": [
    "en",
    "es",
    "pl"
  ],
  "attachLabelIds": [
    1
  ],
  "fields": {
    "some-field-1": "some value 1",
    "some-field-2": 12,
    "some-field-3": true,
    "some-field-4": [
      "en",
      "ja"
    ]
  }
}

Response

File was successfully added

Example response

{
  "data": {
    "id": 44,
    "projectId": 2,
    "branchId": 34,
    "directoryId": 4,
    "name": "umbrella_app.xliff",
    "title": "source_app_info",
    "context": "Context for translators",
    "type": "xliff",
    "path": "/directory1/directory2/filename.extension",
    "status": "active",
    "revisionId": 1,
    "priority": "normal",
    "importOptions": {
      "scheme": {
        "identifier": 0,
        "sourcePhrase": 1,
        "en": 2,
        "de": 3
      }
    },
    "exportOptions": {
      "exportPattern": "/localization/%locale%/%file_name%.%file_extension%"
    },
    "excludedTargetLanguages": [
      "en",
      "es",
      "pl"
    ],
    "parserVersion": 12,
    "createdAt": "2019-09-19T15:10:43+00:00",
    "updatedAt": "2019-09-19T15:10:46+00:00",
    "fields": {
      "some-field-1": "some value 1",
      "some-field-2": 12,
      "some-field-3": true,
      "some-field-4": [
        "en",
        "ja"
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.