Create a Localization Policy

post

/content/management/api/v1.1/localizationPolicies

Creates a localization policy with the given payload.
The created localization policy will ensure
  • to deliver the item having the exact requested language, if published
  • to deliver the item in defined default language, if published
  • to deliver the item, if published, which referred to the unavailable translation.
  • It will also ensure
  • that a translation for every language specified in LocalizationPolicy.requiredValues must be published with a translation set
  • that any translation with a language specified in the LocalizationPolicy.optionalValues may be published with a translation set.
  • Request

    Supported Media Types
    Query Parameters
    Header Parameters
    Body ()
    Creates a localization policy with the given information in the payload. The fields id, createdBy, createdDate, updatedBy, updatedDate and links will be ignored even if given in the payload.
    Root Schema : LocalizationPolicy
    Type: object
    Localization Policy
    Show Source
    Nested Schema : date
    Type: object
    date
    Show Source
    Nested Schema : optionalValues
    Type: array
    Optional language values.
    Show Source
    Nested Schema : requiredValues
    Type: array
    Required language values.
    Show Source
    Back to Top

    Response

    Supported Media Types

    201 Response

    Created.
    Body ()
    Root Schema : LocalizationPolicy
    Type: object
    Localization Policy
    Show Source
    Nested Schema : date
    Type: object
    date
    Show Source
    Nested Schema : optionalValues
    Type: array
    Optional language values.
    Show Source
    Nested Schema : requiredValues
    Type: array
    Required language values.
    Show Source

    400 Response

    Bad request.

    403 Response

    Forbidden.

    404 Response

    Not found.

    500 Response

    Internal server error.
    Back to Top

    Examples

    The following example shows how to create a localization policy by submitting a POST request on the REST resource using cURL.

    curl -X POST -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'http://host:port/content/management/api/v1.1/policy'

    Example:

    This creates a localization policy with a list of required and a list of optional languages, where en-IN, en-AU and en-US are language codes. Replace payload with your own data.

    /content/management/api/v1.1/localizationPolicies

    Request Body

    {
      "name": "policy4",
      "description": "policy4 description",
      "requiredValues": [
        "en-AU",
        "en-US"
      ],
      "optionalValues": [
        "en-IN",
        "en-US"
      ]
    }
    Back to Top