Up - API Reference - Home
Requires JWT.
Add a localization to a project
You can only add from the predefined global languages list, see /api/languages/get.
POST /api/p/<project gid>/languages/add
Authorization: Bearer <JWT>
{
"language": "de"
}
Note: the language must be given in lower-case, always
Authorization: <JWT>
{
"success": true,
"result": {
"project": "<project gid>"
},
"data": {
"cc.projects": {
"<project gid>": {
"name": "Project Name",
"status": "active",
…
}
},
"definitions": {
"<definition gid>": {
…,
"label": {
"en": "Base",
"nl": "Basis",
"de": "Base"
},
…
},
…
},
"classes": {…},
"fields": {…},
"layouts": {…},
}
}
project is the current project.
cc.projects is a dictionary with the current project.
definitions is a dictionary holding all definitions for the project.
classes is a dictionary holding all classes for the project.
fields is a dictionary holding all fields for the project.
layouts is a dictionary holding all layouts for the project.
Note that all localized properties have an extra key for the added language. The value is based on the closest matching language from the project. For nl-be this would be nl, and for de this is en (the default).
400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - cannot perform update