CMS Tool API

CMS Tool API schema

Public API version 1.4.60.

Languages

Every language the system knows, with whether it is the website's primary language (the language its content is written in) and whether it is enabled as an alternative language the website is translated into.

Endpoint URL

https://api.cms-tool.net/api/languages

/api/languages

Read every language with whether it is the website's primary language or an enabled alternative language, and change them.

GET

List the languages, or retrieve one by appending its code to the path. Needs the languages:read scope.

Query parameters

NameTypeExampleNotes
languagetextfrLanguage code, as the languages endpoint lists them, for example fr.
enabledbooleantrueFilter results by whether the language is one of the website's alternative languages. Accepts true or 1.
primarybooleantrueFilter results to the website's primary language. Accepts true or 1.
keywordstextexampleFilter results by keywords.
offsetint123Skip this many matching records before returning results.
pageSizeint123Limit the number of records returned; accepted values are 1 through 999, with 200 used otherwise.

POST

Make a language the primary language (primary true), or add or remove it as an alternative language (enabled true or false). Removing a language keeps its translations. Needs the languages:write scope and the configuration permission.

Request content type: application/json

Request body fields

NameTypeExampleNotes
languagetextfrLanguage code, as the languages endpoint lists them, for example fr. Required for a translation, and it must be one of the website's alternative languages.
primarybooleantrueTrue makes this the primary language: the language the website's content is written in. Accepts true or 1.
enabledbooleantrueTrue adds the language as an alternative language the website is translated into; false removes it and keeps its translations. Accepts true or 1.

Data definitions

FieldTypeDescriptionFormatExample
languagetextLanguage code, for example en or fr.
idtextThe language code. The same as language.
enabledboolTrue when the language is an alternative language the website is translated into. Visitors can choose it, and translations are kept for it.
languagenametextName of the language in English.
primaryboolTrue for the website's primary language: the language its content is written in. A website has one.

Usage instructions and examples

List the languages with GET /api/languages (filter with enabled=true for the alternative languages), or read one with GET /api/languages/{code}. POST {"language": "fr", "enabled": true} to add an alternative language and {"language": "fr", "enabled": false} to remove one; removing a language keeps its translations. POST {"language": "en", "primary": true} to change the primary language. Changes need the configuration permission.

Sample object

{"id": "fr", "language": "fr", "languagename": "French", "primary": false, "enabled": true}

Machine-readable documentation

This documentation is also available as JSON or Markdown at the same URL. Request JSON with Accept: application/json or Markdown with Accept: text/markdown.