CMS Tool API

CMS Tool API schema

Public API version 1.4.60.

Translation Phrases

The website's phrases: the text found in its pages, theme and prompts, each of which can be translated into the website's alternative languages with the translations endpoint.

Endpoint URL

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

/api/translations_phrases

Read the website's phrases, the text found in its content that translations translate, and find new ones.

GET

List the phrases with the languages each is translated into, or retrieve one by appending its ID to the path. untranslated true lists the phrases with no translation in any language. Needs the translations_phrases:read scope.

Query parameters

NameTypeExampleNotes
keywordstextexampleFilter results by keywords.
objectTypetextexampleFilter results by object type.
objectIdint123Filter results by object id.
untranslatedbooleantrueFilter results to phrases with no translation in the language yet. Accepts true or 1.
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

FindNewPhrases true finds the text of the website's pages, theme and prompts and adds the phrases it does not have yet, as Find New Phrases in the CMS. Nothing is removed. Needs the translations_phrases:write scope and the seo permission.

Request content type: application/json

Request body fields

NameTypeExampleNotes
FindNewPhrasesbooleantrueFind the text of the website's pages, theme and prompts, and add the phrases the website does not have yet. Accepts true or 1.

Data definitions

FieldTypeDescriptionFormatExample
phrasetextText exactly as it appears on the website in its primary language.
languagestextCodes of the languages the phrase has a translation in, separated by commas. Null when it has none.
object_typetextWhere the phrase was found: Template (the whole website, and phrases added through the API), Page, Prompt, Blog, Cat or Event.
idintID of the phrase, as the translations endpoint uses it.
object_idintID of the page or other item the phrase was found in.

Usage instructions and examples

List the phrases with GET /api/translations_phrases (untranslated=true for those with no translation in any language, objectType and objectId for where they were found), or read one with GET /api/translations_phrases/{id}. POST {"FindNewPhrases": true} to find the text of the website's pages, theme and prompts and add the phrases it does not have yet, as Find New Phrases in the CMS; run it after content changes, then translate the new phrases with the translations endpoint. Nothing is removed. Finding phrases needs the seo permission.

Sample object

{"id": 1234, "phrase": "Opening hours", "object_type": "Page", "object_id": 112137, "languages": "fr,de"}

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.