Strings

Uploads an array of strings to a Smartling project. A maximum of 100 strings can be created per request. A request with more than 100 items will return an error. Each string has a character limit of 10,000.

Smartling creates a unique hashcode for each string based on the parsed string text and any variant or namespace metadata provided. If you upload a string with the same text, variant and namespace, and therefore the same hashcode, the existing string will be overwritten. This will not change the text of the string, but may update other metadata, such as placeholder and callback values. If the string is currently inactive, overwriting it will reactivate it. Overwritten strings return "overWritten": "true" in the response object.

Most uploads will return a 200 response indicating success. If processing the request takes longer than 60 seconds, a 202 response will be returned, including a processUid value that can be used to check the progress of the request.

If you set up a POST callback for the string, you can automatically receive the translation for a string as soon as it is complete. See Callbacks for more details.

post/strings-api/v2/projects/{projectUid}

Request

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

Path parameters

projectUidstring 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

placeholderFormatstring

Specifies a standard placeholder format. Accepted values are none, c, ios, python, java, yaml, qt, resx. See Placeholders in Resource Files for more detail.

placeholderFormatCustomstring

Specifies a custom placeholder with a Java Regular Expression. For example \[.+?\] would capture all values surrounded by square brackets as placeholders. See Placeholders in Resource Files for more detail.

namespacestring

Used to generate the unique hashcode for all strings in the request. If you want to have two versions of a string with the same text and variant metadata, you can keep them unique by assigning a different namespace to each string. If not provided, default value is smartling.strings-api.default.namespace. A NULL value is permitted.

uristring

URI path of a source file within a Smartling project.

Example request

{
  "uri": "/content/en/home.json",
  "authorization": {
    "localeWorkflows": [
      {
        "targetLocaleId": "fr-FR",
        "workflowUid": "5449a8595ae4"
      }
    ],
    "translationJobUid": "j45v1uvsi3tx"
  }
}

Response

OK

Example response

{
  "response": {
    "data": {
      "items": [
        {
          "hashcode": "d41d8cd98f00b204e9800998ecf8427e"
        }
      ],
      "processUid": "097ecbc2-8f1b-4ce5-b5c4-d48c3f0e5d9e"
    }
  }
}

Changes