Files

This uploads original source content to Smartling.

The curl example provided will upload your Java properties file directly into the Smartling project identified by the projectId. Smartling will ingest this file, parse out the keys and text as strings for translation. At this point, content is ready for translation.

post/files-api/v2/projects/{projectId}/file

Request

  • Base URL
    https://api.smartling.com
  • Auth
    HTTP bearer

Path parameters

projectIdstring required

Unique identifier of a Smartling project — 9 lowercase alphanumeric characters.

Example:84c012a33

A unique project identifier. This can be found in the Smartling Dashboard under Account Settings > API.

Request body multipart/form-data

filestring binary required

The file contents to upload.

fileUristring required

A value that uniquely identifies the uploaded file. This ID can be used to request the file back. We recommend that you use file path and file name, similar to how version control systems identify the file.

The maximum length is 512 characters.

Example: /myproject/i18n/ui.properties

fileType'android' | 'arb' | 'asciidoc' | 'csv' | 'dita' | 'ditaZip' | 'doc' | 'docm' | 'docx' | 'flare' | 'fluent' | 'freemarker' | 'gettext' | 'html' | 'idml' | 'imageJpg' | 'imagePng' | 'imageWebp' | 'indd' | 'ios' | 'javaProperties' | 'json' | 'madcap' | 'markdown' | 'mdx' | 'pdf' | 'plainText' | 'ppt' | 'pptx' | 'pres' | 'qt' | 'resx' | 'rtf' | 'srt' | 'stringsdict' | 'svg' | 'vsdm' | 'vsdx' | 'vtt' | 'xcstrings' | 'xliff' | 'xliff2' | 'xls' | 'xlsx' | 'xlsxTemplate' | 'xml' | 'yaml' required

A unique identifier for the file type.

smartling.namespacestring

This is only for accounts created after July 31st, 2015. Define a custom namespace for the file.

Note: While this parameter shares the format of other file directives, it will not work as an inline directive and must be specified in the API call.

smartling.file_charsetstring

Specifies a custom charset for text-format files. The value should be the name of the character set. See a full list of supported character sets here.

If this directive is not used, Smartling will use the Content-Type request header to determine if the content is encoded with UTF-16, UTF-16B or UTF-16LE. If there is no Content-Type header, Smartling will examine the file for UTF-16 characters. If none are detected, UTF-8 encoding will be used.

Note: Once this property has been set for a file, it cannot be changed. If you reupload the file, it will use the original charset, even if you change the directive. An error will be returned if this directive is used when uploading binary-format file types, such as Office or IDML files.

smartling.[command]string

Provides custom parser configuration for supported file types. See Supported File Types for more details.

callbackUrlstring uri

A GET request that creates a callback to a URL when all authorized strings from a file are 100% published for a locale.* The callback gives the fileUri and locale with the format http[/s]://your.url?locale=xx-XX&fileUri=your.file. If you upload the file again, without a callbackUrl, it will remove any previous callbackUrl for that file. The RequestBin (http://requestb.in) service is a convenient way to test a callback. RequestBin generates a short-lived disposable URL that displays all posted requests.

If a callback fails, Smartling will make multiple attempts to reach the designated URL. However, we do not keep retrying a failed callback indefinitely. Try to make sure your callback URL is as stable as possible and be aware that callbacks are not a 100% reliable way of being notified that a file is published.

If the upload has begun but is taking more than a minute to complete, it responds with a 202 status.

*This is the default behavior. There are cases when the callback could be triggered even when not all authorized strings are published, depending on your project configuration. Contact your Smartling Representative if you have questions about your project’s callback configuration.

Response

OK

Changes

    • breaking

      added the pattern ^[a-z0-9]{9}$ to the path request parameter projectId

    • breaking

      removed the enum value java_properties of the request property

    • breaking

      removed the enum value plain_text of the request property

    • breaking

      the request property format changed from url to uri

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • info

      for the path request parameter projectId, the format was generalized from uid to no format

    • info

      added the new arb enum value to the request property

    • info

      added the new asciidoc enum value to the request property

    • info

      added the new dita enum value to the request property

    • info

      added the new ditaZip enum value to the request property

    • info

      added the new docm enum value to the request property

    • info

      added the new flare enum value to the request property

    • info

      added the new fluent enum value to the request property

    • info

      added the new freemarker enum value to the request property

    • info

      added the new imageJpg enum value to the request property

    • info

      added the new imagePng enum value to the request property

    • info

      added the new imageWebp enum value to the request property

    • info

      added the new indd enum value to the request property

    • info

      added the new javaProperties enum value to the request property

    • info

      added the new mdx enum value to the request property

    • info

      added the new pdf enum value to the request property

    • info

      added the new plainText enum value to the request property

    • info

      added the new rtf enum value to the request property

    • info

      added the new svg enum value to the request property

    • info

      added the new vsdm enum value to the request property

    • info

      added the new vsdx enum value to the request property

    • info

      added the new vtt enum value to the request property

    • info

      added the new xcstrings enum value to the request property

    • info

      added the new xliff2 enum value to the request property

    • warning

      the request property's maxLength was set to 255

    • warning

      the request property's maxLength was set to 512

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      added the new xlsxTemplate enum value to the request property