Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

scope

The scope object. It delimits the total range of segments and related resources that can be queried.

Example:

Code Block
"scope": { "type": "Project", "projectid": 1234 }


Mandatory, object
layout

Optional layout object. The layout is required when updating language level content such as source text or translation text.

If not specified, the system expects that update operations are for the scope's source and first target language. This may not be what is expected. It is strongly recommended to explicitly set this object with the language(s) to be updated.

Example for updating French and English content. The index is assigned starting from 0 and will be referenced in the updates node below. Property ftype defines the type of column, value 1 refers to the text content.

Code Block
"layout": {
		"columns": [
			{ "index": 0, "ftype": 1, "loc": "fr" },
			{ "index": 1, "ftype": 1, "loc": "en-US" }
		]
	}

When updating language custom fields or labels, to attach comments to a language, etc. then you will need to add more columns to target those properties. Please see  layout object for more information.

Segment level fields including segment custom fields, do not require column definitions.


Optional, object?
updates

An array with update instructions.

Example to update the English (United States) translation. The "_1" property key refers to the layout column with index = 1, prefixed with an underscore character. The sid property is the segment ID.

Code Block
"updates": [
		{
			"sid": 21567228,
			"cols": {
				"_1": { "txt": { "val": "My new translation" } }
			}
		}
	]

Example for updating translation and setting the status to OK (green) - see resources/segments/search to learn more on the different fields and values.

Example for updating multiple segments, source texts, translations and status:

Code Block
"updates": [
		{
			"sid": 21567228,
			"cols": {
				"_1": { "txt": { "val": "Please click here", "st": 1 } }
			}
		},
		{
			"sid": 21567240,
			"cols": {
				"_0": { "txt": { "val": "Öffne den Dialog" } },
				"_1": { "txt": { "val": "Open the dialog", "st": 1 } }
			}
		}
	]



Optional,

string

usecacheuseCache

Optional boolean, default is true.

Set to false only if there is a possibility that user access rights have changed. False enforces the system to recalculate all access rights for the specified scope.

Optional, bool?

...