GET /admin/api/languages
Example response:
Status: 200 OK
[
{
"id": 1,
"code": "en",
"title": "ENG",
"site_title": "My new site",
"position": 1,
"default_language": false,
"published": "true",
"created_at": "2014-01-20T09:19:04.000Z",
"updated_at": "2014-01-20T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1",
"move_url": "http://helloworld.voog.co/admin/api/languages/1/move",
"contents_url": "http://helloworld.voog.co/admin/api/languages/1/contents",
"pages_url": "http://helloworld.voog.co/admin/api/pages?language_id=1"
}, {
"id": 2,
"code": "fr",
"title": "FRA",
"site_title": "Mon nouveau site",
"position": 2,
"default_language": false,
"published": "true",
"created_at": "2014-01-21T14:43:48.000Z",
"updated_at": "2014-01-21T14:43:48.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/2",
"move_url": "http://helloworld.voog.co/admin/api/languages/2/move",
"contents_url": "http://helloworld.voog.co/admin/api/languages/2/contents",
"pages_url": "http://helloworld.voog.co/admin/api/pages?language_id=2"
}
]
per_page
- elements per response (default: 50
; maximum: 250
).page
- requested page (default: 1
).Read more about filters.
language
attributes: id
, code
, title
, position
, published
, default_language
, created_at
, updated_at
.POST /admin/api/languages
The request adds new language to the end of the language list and creates automatically a front page for it.
Example data:
{
"code": "et",
"title": "Eesti",
"site_title": "Minu uus sait",
"site_header": "Tere tulemast uuele saidile!"
}
Example response:
Status: 201 Created
{
"id": 3,
"code": "et",
"title": "Eesti",
"site_title": "Minu uus sait",
"position": 3,
"default_language": false,
"published": "true",
"created_at": "2014-01-21T14:53:11.000Z",
"updated_at": "2014-01-21T14:53:11.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/3",
"move_url": "http://helloworld.voog.co/admin/api/languages/3/move",
"contents_url": "http://helloworld.voog.co/admin/api/languages/3/contents",
"pages_url": "http://helloworld.voog.co/admin/api/pages?language_id=3"
}
Required parameters:
code
- two-letter language code (see more: ISO 639-1).title
- language title for language menu.Optional parameters:
site_title
- language specific site title (overrides global site title) mostly used for html title
section.site_header
- language specific site header (language specific content area).default_language
- if present and value is true
then newly created language is set as default language (default: false
).published
- determines whether the language is publicly visible or not (default: true
)GET /admin/api/languages/1
Example request:
GET http://helloworld.voog.co/admin/api/languages/1
Example response:
Status: 200 OK
{
"id": 1,
"code": "en",
"title": "ENG",
"site_title": "My new site",
"site_header": "My site header",
"position": 1,
"default_language": false,
"published": "true",
"created_at": "2014-01-20T09:19:04.000Z",
"updated_at": "2014-01-20T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1",
"move_url": "http://helloworld.voog.co/admin/api/languages/1/move",
"contents_url": "http://helloworld.voog.co/admin/api/languages/1/contents",
"pages_url": "http://helloworld.voog.co/admin/api/pages?language_id=1"
}
PUT /admin/api/languages/1
This request updates the language with provided attributes.
Example request:
PUT http://helloworld.voog.co/admin/api/languages/3
Example data:
Status: 200 OK
{
"title": "EN",
"site_title": "Hello, world!",
"default_language": true
}
Example response:
Status: 200 OK
{
"id": 1,
"code": "en",
"title": "EN",
"site_title": "Hello, world!",
"site_header": "My site header",
"position": 1,
"default_language": true,
"published": "true",
"created_at": "2014-01-20T09:19:04.000Z",
"updated_at": "2014-01-21T15:00:11.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1",
"move_url": "http://helloworld.voog.co/admin/api/languages/1/move",
"contents_url": "http://helloworld.voog.co/admin/api/languages/1/contents",
"pages_url": "http://helloworld.voog.co/admin/api/pages?language_id=1"
}
Optional parameters:
code
- two-letter language code (see more: ISO 639-1).title
- language title for language menu.site_title
- language specific site title (overrides global site title) mostly used for html title
section.site_header
- language specific site header (language specific content area).default_language
- if present and value is true
in request then current language is set as default language (default: false
).published
- determines whether the language is publicly visible or not (default: true
)PUT /admin/api/languages/1/move
Moves the language in languages list.
Example request:
PUT http://helloworld.voog.co/admin/api/languages/3/move?before=1
Example response:
Status: 200 OK
{
"id": 3,
"code": "et",
"title": "Eesti",
"site_title": "Minu uus sait",
"position": 1,
"default_language": false,
"published": "true",
"created_at": "2014-01-21T14:53:11.000Z",
"updated_at": "2014-01-21T14:53:11.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/3",
"move_url": "http://helloworld.voog.co/admin/api/languages/3/move",
"contents_url": "http://helloworld.voog.co/admin/api/languages/3/contents",
"pages_url": "http://helloworld.voog.co/admin/api/pages?language_id=3"
}
Optional parameters:
before
- existing language id. Moves the language before given language. (E.g. ?before=2
)after
- existing language id. Moves the language after given language. (E.g. ?after=1
)PUT /admin/api/languages/enable_autodetect
This request enables language automatic detection for site visitors by setting default_language
value to false
for all languages.
Example request:
PUT /admin/api/languages/enable_autodetect
Example response:
Status: 204 No Content
DELETE /admin/api/languages/1
This request deletes the language from the database.
Example request:
DELETE http://helloworld.voog.co/admin/api/languages/3
Example response:
Status: 204 No Content