...
Note that all the core properties of a segment such as its ID are always returned by queries independently from the columns.Although you can add any columns to the layout, a query will only return the columns to which the user has access. For example, if a user cannot view the Spanish translations, a query will drop this column.
A sample layout to retrieve English and French texts would be:
Code Block |
---|
{
"columns": [
{ "fkey": "1~en~0" },
{ "fkey": "1~fr~0" },
]
} |
Column identifier "fkey"
Each data column is uniquely identified by a string ("fkey"). When requesting data you need to specify the "fkey" values you want to obtain.
...
Code Block |
---|
{ftype}#{loc}#{fqualifier} |
- "ftype" is the type of the column (a number)
- "loc" is the language of the column (if the column is specific for a language)
- "fqualifier" is used with custom field and label columns only and corresponds to the CF/label id.
Column types
Available column types are:
...
fkey | Uniquely identifies the content of the column. When querying data you only need to include this property. All other properties below are for information purposes only. The format is:
Examples:
| string | ||||
Properties for information only: | ||||||
ftype | The type of the column. It is embedded inside "fkey". | int | ||||
loc | The language code for the column. Some columns do not require a language and others do. There are two means to specific languages: a) Explicit language codes: "en", "fr-FR" ... b) Language indexes: "#0", "#1", .... The system then replaces "#0" with the first language in the scope, "#1" with the second one ...
Language indexes can be used to work with generic layouts that can dynamically "adapt" to scopes. For example you could use a job layout that specifies two columns. One with the first language (source language) and another with the second language (first target language). | string | ||||
canEdit | If false then this column is not editable by the user. Note that this is a general access right. You need to look at the access rights details sent back with each segment. | bool | ||||
fqualifier | Used with certain data columns such as custom fields and labels. This then describes the CF or label ID. 0 if not applicable to field type. | int |
EXAMPLES
A layout for querying data. Note that you only need to specify the "fkey" properties:
Code Block |
---|
{
"columns": [
{
"fkey": "1~en~0"
},
{
"fkey": "1~fr~0"
},
{
"fkey": "1~es~0"
},
{
"fkey": "6~fr~0"
},
{
"fkey": "13~fr~0"
},
{
"fkey": "12~es~0"
}
]
} |
A layout with 2 languages and a few fieldsfull details:
Code Block |
---|
{ "name": null, "columns": [ { "ftype": 1, "loc": "en", "canEdit": true, "fqualifier": 0, "fkey": "1~en~0" }, { "ftype": 1, "loc": "fr", "canEdit": true, "fqualifier": 0, "fkey": "1~fr~0" }, { "ftype": 1, "loc": "es", "canEdit": true, "fqualifier": 0, "fkey": "1~es~0" }, { "ftype": 6, "loc": "fr", "canEdit": true, "fqualifier": 0, "fkey": "6~fr~0" }, { "ftype": 13, "loc": "fr", "canEdit": true, "fqualifier": 0, "fkey": "13~fr~0" }, { "ftype": 12, "loc": "es", "canEdit": false, "fqualifier": 0, "fkey": "12~es~0" } ] } |
...