Create a Custom Language Code
post
/content/management/api/v1.1/l10n/languageCodes
Creates a custom language code with the given payload.
Request
Supported Media Types
- application/json
Query Parameters
-
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby
Header Parameters
-
X-Requested-With: string
A custom header to mitigate CSRF attacks.Allowed Values:
[ "XMLHttpRequest" ]
Creates a language code with the given information in the payload. Language code is case-insensitive i.e., cannot create a language code with existing language code even in a different case. Only code and description will be considered from payload. Code should be maximum of 64 characters and description should be maximum of 128 characters. All other fields will be ignored even if given in the payload.
Root Schema : LanguageBean
Type:
Show Source
object
-
code(optional):
string
locale code
-
createdBy(optional):
string
Created by.
-
createdDate(optional):
object date
date
-
description(optional):
string
Locale description
-
language(optional):
string
Locale language
-
languageType(optional):
string
lindicates if this is custom locale or default locale
-
links(optional):
array links
-
script(optional):
string
Script from language code
-
territory(optional):
string
Language code territory
-
updatedBy(optional):
string
Updated by.
-
updatedDate(optional):
object date
date
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
Response
Supported Media Types
- application/json
201 Response
Created.
Root Schema : LanguageBean
Type:
Show Source
object
-
code(optional):
string
locale code
-
createdBy(optional):
string
Created by.
-
createdDate(optional):
object date
date
-
description(optional):
string
Locale description
-
language(optional):
string
Locale language
-
languageType(optional):
string
lindicates if this is custom locale or default locale
-
links(optional):
array links
-
script(optional):
string
Script from language code
-
territory(optional):
string
Language code territory
-
updatedBy(optional):
string
Updated by.
-
updatedDate(optional):
object date
date
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
400 Response
Bad request.
404 Response
Not found.
409 Response
Conflict.
500 Response
Internal server error.
Examples
The following example shows how to creates a custom language code with the given payload by submission of a POST request on the REST resource using cURL:
curl -X POST -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'https://host:port/content/management/api/v1.1/l10n/languageCodes'
Example 1:
This creates a custom language code. Replace payload with your own data.
/content/management/api/v1.1/l10n/languageCodes
Request Payload
{ "code": "en-x-my-custom-subtag", "description": "en-x-my-custom-subtag description." }
Request Headers
{ "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" }
Response Body
{ "code": "en-x-my-custom-subtag", "language": "English", "description": "en-x-my-custom-subtag description", "territory": null, "script": null, "languageType": "custom", "createdBy": "swebcli.SitesAdmin1.admin", "createdDate": { "value": "2020-04-30T18:37:20.671Z", "timezone": "UTC" }, "updatedBy": "swebcli.SitesAdmin1.admin", "updatedDate": { "value": "2020-04-30T18:37:20.671Z", "timezone": "UTC" }, "links": [ { "href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes", "rel": "self", "method": "POST", "mediaType": "application/json" }, { "href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes", "rel": "canonical", "method": "POST", "mediaType": "application/json" }, { "href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/metadata-catalog/l10n/languageCodes", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] }