Validate the Content of a Site

post

/sites/management/api/v1/sites/{id}/validate

EXTENDED OPERATION

Validate the pages of an enterprise site with regards to translations. When a site is validated the pages are checked to see if the translations match up with the localization policy and language details of the site channel. Per page details are provided that give an indication to whether the page has missing translations and for what languages. Assets used on the page are also listed indicating the version of each asset, such as whether the asset is draft or published.

Introduced in release 19.4.1.

Authorization

To invoke this operation, the authenticated user or client application must have been shared with the resource and have one of the following sharing roles:

  • Owner
  • Manager

Path Alternative Identifiers

The default identifier for a Site resource is the Site Identifier. The Site resource supports alternative identifiers.

nameSite Name

Instead of the site identifier, the site name can be used to uniquely identify a site in the resource path. The default resource path parameter for a site is the site identifier, but when working with sites the human-readable site name is sometimes easier.

http://api.example.com/sites/management/api/v1/sites/name:MyNewProduct/validate

Introduced in release 19.4.1.

Successful Response Examples

This operation responds with the following success (2xx) responses. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.

200OK - Valid Site Results

A a successful validation result include details of the siteinfo, structure pages and a home page.

Request

POST https://api.example.com/sites/management/api/v1/sites/{id}/validate

Response Body

{
  "valid": false,
  "pages": [
      {
        "id": "siteinfo",
        "name": "siteinfo",
        "type": "siteinfo",
        "publishable": false,
        "languages": [
            {
              "language": "fr-FR",
              "policyStatus": "required",
              "validation": "missing"
            },
            {
              "language": "de-DE",
              "policyStatus": "optional",
              "validation": "ready"
            },
            {
              "language": "es-ES",
              "policyStatus": "undefined",
              "validation": "excluded"
            }
        ],
        "usedAssets": [
        ]
      },
      {
        "id": "structure",
        "name": "structure",
        "type": "structure",
        "publishable": false,
        "languages": [
            {
              "language": "fr-FR",
              "policyStatus": "required",
              "validation": "missing"
            },
            {
              "language": "de-DE",
              "policyStatus": "optional",
              "validation": "ready"
            },
            {
              "language": "es-ES",
              "policyStatus": "undefined",
              "validation": "excluded"
            }
        ],
        "usedAssets": [
        ]
      },
      {
        "id": "10",
        "name": "Home",
        "type": "page",
        "publishable": false,
        "languages": [
            {
              "language": "fr-FR",
              "policyStatus": "required",
              "validation": "missing"
            },
            {
              "language": "de-DE",
              "policyStatus": "optional",
              "validation": "ready"
            },
            {
              "language": "es-ES",
              "policyStatus": "undefined",
              "validation": "excluded"
            }
        ],
        "usedAssets": [
            {
              "id": "CORED2FDC62C23504F6AB47B1F6106F9DC73",
              "version": "draft"
            },
            {
              "id": "CORE48AF98371AFC4568B260D4417E38A739",
              "version": "published"
            },
            {
              "id": "CONTBD592905665C4652BFEAE6FD19E9F291",
              "version": "draft"
            },
            {
              "id": "CONT9DE7B749A5E9438689492A0054C02707",
              "version": "draft"
            }
        ]
      }
  ]
}

Client Error Response Examples

This operation responds with following client error (4xx) responses with exception details in the response body. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.

403Forbidden - Site Operation Forbidden

Your sharing role within the site does not allow you to perform the operation.

Error Code

OCE-SITEMGMT-009026

Resolution - Change the Sharing Role

Change the sharing role given to the authenticated user to the required role or higher.

Resolution - Change the Application Role

Ensure the user has a Standard User or Enterprise User Application Role.

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
siteSite on which the operation is being performed.

For detailed information about this exception detail type, consult the SiteOperationForbiddenExceptionDetail schema in the definitions section of the swagger document.

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Site Operation Forbidden",
  "status": "403",
  "detail": "You do have a sharing role in this site, but your role does not allow you to use this operation.",
  "o:errorCode": "OCE-SITEMGMT-009026",
  "site": {
    "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
  }
}

Introduced in release 19.1.5.

404Not Found - Site Not Found

The site does not exist or has been deleted, or the authenticated user or client application does not have access to the site.

Error Code

OCE-SITEMGMT-009003

Resolution - Check Identifier

Check that the site identifier is valid.

Resolution - Check Membership

Check that the authenticated user is a member of the site or a site administrator.

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
siteSite that does not exist or is not visible to the authenticated user.

For detailed information about this exception detail type, consult the SiteNotFoundExceptionDetail schema in the definitions section of the swagger document.

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Site Not Found",
  "status": "404",
  "detail": "Site does not exist or has been deleted, or the authenticated user or client application does not have access to the site.",
  "o:errorCode": "OCE-SITEMGMT-009003",
  "site": {
    "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
  }
}

409Conflict - Site Deleted

The operation cannot be performed on a soft deleted site. This error can only occur when the includeDeleted query parameter is set to true.

Error Code

OCE-SITEMGMT-009059

Resolution - Restore Site

Restore the site and then try the operation again.

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
siteSite that is soft deleted, if the site identifier has been provided.

For detailed information about this exception detail type, consult the SiteDeletedExceptionDetail schema in the definitions section of the swagger document.

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Site Deleted",
  "status": "409",
  "detail": "The operation cannot be performed as the site has been soft deleted.",
  "o:errorCode": "OCE-SITEMGMT-009059",
  "site": {
    "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
  }
}

Introduced in release 19.4.1.

409Conflict - Missing Site Default Language

The site must have a default to perform this operation.

Error Code

OCE-SITEMGMT-001008

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Missing Site Default Language",
  "status": "409",
  "detail": "Default language for the site is missing.",
  "o:errorCode": "OCE-SITEMGMT-001008"
}

Introduced in release 19.4.1.

409Conflict - Missing Site Localization Policy

The site must have a localization policy to perform this operation.

Error Code

OCE-SITEMGMT-009074

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Missing Site Localization Policy",
  "status": "409",
  "detail": "Localization policy for site is missing.",
  "o:errorCode": "OCE-SITEMGMT-009074"
}

Introduced in release 19.4.1.

409Conflict - Invalid Site Default Language

Site has a default language that does not match the localization policy's required languages.

Error Code

OCE-SITEMGMT-009075

Exception Detail Fields

This error type includes the following fields/values in the response:

Field NameDescription
defaultLanguageInvalid default language.

For detailed information about this exception detail type, consult the InvalidSiteDefaultLanguageExceptionDetail schema in the definitions section of the swagger document.

Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Invalid Site Default Language",
  "status": "409",
  "detail": "Default Language '{defaultLanguage}' for site is not valid. The default language must be one of the localization policy's required languages.",
  "o:errorCode": "OCE-SITEMGMT-009075",
  "defaultLanguage": "en-US"
}

Introduced in release 19.4.1.

Request

Path Parameters
Query Parameters
  • Resources that have been marked for deletion can be read, modified, and support extended operations as long this query parameter is set to true. When the includeDeleted query parameter is not sent then the response to read, modification, and extended operations will be identical to that which would be returned if the resource was permanently deleted.

Back to Top

Response

Supported Media Types

200 Response

OK
Headers
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : SiteValidationResult
Type: object

Result of site content validation against localization policy configured on site channel.

Show Source
Nested Schema : pages
Type: array

List of page objects including siteinfo and structure.

Show Source
Nested Schema : items
Match All
Show Source
Nested Schema : SitePageValidationResult
Type: object

Result for an individual page for site content validation against localization policy configured on site channel.

Show Source
Nested Schema : languages
Type: array

List of language validation information for each site page. The siteinfo and structure pages are included in this list. Lists all languages defined in the site channel localization policy plus languages the page is translated into.

Show Source
Nested Schema : usedAssets
Type: array

List of asset validation information for assets used by the site.

Show Source
Nested Schema : items
Match All
Show Source
Nested Schema : LanguageValidationResult
Type: object

Result for an individual page for site content validation against localization policy configured on the site channel.

Show Source
  • Language.

  • Localization policy validation status for this language.

    Valid values are:

    • required - Required language translation is missing
    • optional - Required language translation is optional
    • undefined - Language not defined by localization policy

  • Validation status for this language.

    Valid values are:

    • missing - Page language missing
    • ready - Page language ready
    • excluded - Page language excluded

Nested Schema : items
Match All
Show Source
Nested Schema : UsedAsset
Type: object

Information about an asset used on a site page.

Show Source
Example Response (Valid Site Results)
{
    "valid":false,
    "pages":[
        {
            "id":"siteinfo",
            "name":"siteinfo",
            "type":"siteinfo",
            "publishable":false,
            "languages":[
                {
                    "language":"fr-FR",
                    "policyStatus":"required",
                    "validation":"missing"
                },
                {
                    "language":"de-DE",
                    "policyStatus":"optional",
                    "validation":"ready"
                },
                {
                    "language":"es-ES",
                    "policyStatus":"undefined",
                    "validation":"excluded"
                }
            ],
            "usedAssets":[
            ]
        },
        {
            "id":"structure",
            "name":"structure",
            "type":"structure",
            "publishable":false,
            "languages":[
                {
                    "language":"fr-FR",
                    "policyStatus":"required",
                    "validation":"missing"
                },
                {
                    "language":"de-DE",
                    "policyStatus":"optional",
                    "validation":"ready"
                },
                {
                    "language":"es-ES",
                    "policyStatus":"undefined",
                    "validation":"excluded"
                }
            ],
            "usedAssets":[
            ]
        },
        {
            "id":"10",
            "name":"Home",
            "type":"page",
            "publishable":false,
            "languages":[
                {
                    "language":"fr-FR",
                    "policyStatus":"required",
                    "validation":"missing"
                },
                {
                    "language":"de-DE",
                    "policyStatus":"optional",
                    "validation":"ready"
                },
                {
                    "language":"es-ES",
                    "policyStatus":"undefined",
                    "validation":"excluded"
                }
            ],
            "usedAssets":[
                {
                    "id":"CORED2FDC62C23504F6AB47B1F6106F9DC73",
                    "version":"draft"
                },
                {
                    "id":"CORE48AF98371AFC4568B260D4417E38A739",
                    "version":"published"
                },
                {
                    "id":"CONTBD592905665C4652BFEAE6FD19E9F291",
                    "version":"draft"
                },
                {
                    "id":"CONT9DE7B749A5E9438689492A0054C02707",
                    "version":"draft"
                }
            ]
        }
    ]
}

400 Response

Bad Request

401 Response

Unauthorized

403 Response

Forbidden
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : SiteOperationForbiddenExceptionDetail
Introduced in release 19.1.5.
Match All
Show Source
Nested Schema : ExceptionDetail
Type: object

In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Show Source
Nested Schema : SiteOperationForbiddenExceptionDetail-allOf[1]
Type: object
Show Source
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • ExceptionDetail

    In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Example Response (Site Operation Forbidden)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Site Operation Forbidden",
    "status":"403",
    "detail":"You do have a sharing role in this site, but your role does not allow you to use this operation.",
    "o:errorCode":"OCE-SITEMGMT-009026",
    "site":{
        "id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
    }
}

404 Response

Not Found
Headers
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : SiteNotFoundExceptionDetail
Match All
Show Source
Nested Schema : ExceptionDetail
Type: object

In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Show Source
Nested Schema : SiteNotFoundExceptionDetail-allOf[1]
Type: object
Show Source
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • ExceptionDetail

    In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Example Response (Site Not Found)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Site Not Found",
    "status":"404",
    "detail":"Site does not exist or has been deleted, or the authenticated user or client application does not have access to the site.",
    "o:errorCode":"OCE-SITEMGMT-009003",
    "site":{
        "id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
    }
}

406 Response

Not Acceptable

409 Response

Conflict
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : SiteDeletedExceptionDetail
Introduced in release 19.4.1.
Match All
Show Source
Nested Schema : ExceptionDetail
Type: object

In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Show Source
Nested Schema : SiteDeletedExceptionDetail-allOf[1]
Type: object
Show Source
  • Site that is soft deleted, if the site identifier has been provided.

    Introduced in release 19.4.1.
Nested Schema : o:errorDetails
Type: array

Multiple errors can be organized in a hierarchical structure.

Show Source
Nested Schema : items
Match All
Show Source
  • ExceptionDetail

    In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such cases, the additional information will be included in the response body.

Example Response (Site Deleted)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Site Deleted",
    "status":"409",
    "detail":"The operation cannot be performed as the site has been soft deleted.",
    "o:errorCode":"OCE-SITEMGMT-009059",
    "site":{
        "id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
    }
}
Example Response (Missing Site Default Language)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Missing Site Default Language",
    "status":"409",
    "detail":"Default language for the site is missing.",
    "o:errorCode":"OCE-SITEMGMT-001008"
}
Example Response (Missing Site Localization Policy)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Missing Site Localization Policy",
    "status":"409",
    "detail":"Localization policy for site is missing.",
    "o:errorCode":"OCE-SITEMGMT-009074"
}
Example Response (Invalid Site Default Language)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Invalid Site Default Language",
    "status":"409",
    "detail":"Default Language '{defaultLanguage}' for site is not valid. The default language must be one of the localization policy's required languages.",
    "o:errorCode":"OCE-SITEMGMT-009075",
    "defaultLanguage":"en-US"
}

413 Response

Payload Too Large

416 Response

Range Not Satisfiable

429 Response

Too Many Requests

500 Response

Internal Server Error

501 Response

Not Implemented

502 Response

Bad Gateway

503 Response

Service Unavailable

504 Response

Gateway Timeout
Back to Top