Import Site Translations

post

/sites/management/api/v1/sites/_importTranslations

EXTENDED OPERATION

Import site translations from a zip file. The zip file contains the details about the site translation and the related translation job. The zip file must first be uploaded to any personal folder of the authenticated user. The zip file for this import should then be specified as part of the request body fields, along with whether the file should be imported or just validated. The import process is asynchronous, and once completed, the site job will contain the details about what was imported or the results of the validation.

Introduced in release 20.1.1.

Authorization

Site translations can be imported by any user that has at least a contributor role in both the site and its repository.

Translate a Site

A translation zip file is created when creating a translation job for a site. This file can be downloaded and translations added. The updated zip file can then be imported to add the translations to the site.

For more information, see Create Translation Job for a Site.

Getting the Progress of the Translations Import

Importing site translations is asynchronous, and the progress can be monitored from the site job status resource.

For more information, see Get the Progress of a Site Related Job.

Asynchronous Processing

This operation only supports asynchronous processing. A Prefer header with the value of respond-async must be included in the request. An accepted response will include a Location header, which provides the location of a status resource that can be polled to obtain information about the asynchronous processing.

For more information about reading the status see Get the Progress of a Site Related Job.

Request Body Alternative Identifiers

The request body references resources that support alternative identifiers. These alternative identifiers can be used instead of using the default resource identifier.

pathFile Path

The default identifier for a Document File resource is the Id.

Instead of the file identifier the file path can be used to identify a file. A path is built up using the names of the parent folders (relative to the user's home folder) followed by the file name, joined by /. File paths can only be used for personal folders; files in shared folders cannot be referenced by path. Folder and file names are case-insensitive.

path:folder1/folder2/file.ext

Introduced in release 19.4.3.

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.

202Accepted - Validate Translation File

Validate the contents of a translation file, without importing the translations. Once the import job completes, it will contain the results of the validation. Depending on the type of translation job, the validation will contain details of the translated site assets or site pages or both.

Request

POST https://api.example.com/sites/management/api/v1/sites/_importTranslations

Request Body

{
  "file": "path:packages/translations/AcmeProductLaunch_fr_de.zip",
  "options": "validate"
}

202Accepted - Import Translation File

Validate and import translations. Once the import job completes, it will contain details of the imported assets or site pages, or both. If the translation file does not have a valid set of translations, the validation will fail and the details of the validation failures will be reported.

Request

POST https://api.example.com/sites/management/api/v1/sites/_importTranslations

Request Body

{
  "file": "path:packages/translations/AcmeProductLaunch_fr_de.zip",
  "options": "import"
}

Client Error Response Examples

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

400Bad Request - Invalid File

A file identified with an identifier cannot be found.

Error Code

OCE-DOCS-001002

Resolution - Check File Exists

Check that the file identifier is valid.

Resolution - Check Sharing Role in Parent Folder

Check that the authenticated user has a role in the folder that contains the file.

Where This Error Can be Returned
  • This error can be returned in the response body.
  • This error will not be returned in the asynchronous job status.
Exception Detail Fields

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

Field NameDescription
fileFile that does not exist.

For detailed information about this exception detail type, consult the InvalidFileExceptionDetail 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 File",
  "status": "400",
  "detail": "File does not exist or the authenticated user or client application does not have access to the file.",
  "o:errorCode": "OCE-DOCS-001002",
  "file": {
    "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
  }
}

Introduced in release 19.4.1.

400Bad Request - Invalid Site

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-009023

Resolution - Check Authorization

Check that the authenticated user is authorized to access to the site.

Where This Error Can be Returned
  • This error will never be returned in the response body.
  • This error can be returned in the asynchronous job status.
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, if the site identifier has been provided.

For detailed information about this exception detail type, consult the InvalidSiteExceptionDetail 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",
  "status": "400",
  "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-009023",
  "site": {
    "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
  }
}

400Bad Request - Invalid Repository

The referenced repository could not be found. Either the repository does not exist or has been deleted, or the authenticated user or client application does not have access to the repository.

Error Code

OCE-CAAS-001006

Resolution - Check Identifier

Check that the repository identifier is valid.

Resolution - Check Membership

Check that the authenticated user is a member of the repository and they have the relevant role to perform the operation relating to the repository.

Where This Error Can be Returned
  • This error will never be returned in the response body.
  • This error can be returned in the asynchronous job status.
Exception Detail Fields

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

Field NameDescription
repositoryRepository that does not exist or is not visible to the authenticated user, if the repository identifier has been provided.

For detailed information about this exception detail type, consult the InvalidRepositoryExceptionDetail 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 Repository",
  "status": "400",
  "detail": "Repository does not exist or has been deleted, or the authenticated user or client application does not have access to the repository.",
  "o:errorCode": "OCE-CAAS-001006",
  "repository": {
    "id": "F81629473A3DB8B2A28669F19E68209BBAD3340745B0"
  }
}

Introduced in release 19.2.3.

400Bad Request - Invalid Site Translation File

Unable to import site translations. The provided file is not in the correct format.

Error Code

OCE-SITEMGMT-009081

Resolution - Check File Format

Check the file is a zip file of the right format.

Where This Error Can be Returned
  • This error will never be returned in the response body.
  • This error can be returned in the asynchronous job status.
Example Response Body
{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
  "title": "Invalid Site Translation File",
  "status": "400",
  "detail": "The file is not a valid site translation file.",
  "o:errorCode": "OCE-SITEMGMT-009081"
}

Introduced in release 20.1.1.

403Forbidden - Storage Limit Reached

Storage transfer limit has been reached. Billing limits have been set on the amount of storage available by the system administrator.

Error Code

OCE-SITEMGMT-009098

Resolution - Increase Storage Limit

Get a system administrator to increase the storage limit.

Where This Error Can be Returned
  • This error will never be returned in the response body.
  • This error can be returned in the asynchronous job status.
Exception Detail Fields

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

Field NameDescription
usedStorage used, in GB.
limitStorage limit, in GB.

For detailed information about this exception detail type, consult the StorageLimitReachedExceptionDetail 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": "Storage Limit Reached",
  "status": "403",
  "detail": "Storage limit has been reached.",
  "o:errorCode": "OCE-SITEMGMT-009098",
  "used": 1.23456789,
  "limit": 1.23456789
}

Introduced in release 20.3.1.

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.

Where This Error Can be Returned
  • This error will never be returned in the response body.
  • This error can be returned in the asynchronous job status.
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.

Request

Supported Media Types
Header Parameters
Body ()

Specify the translation file to import, and whether to do validation only.

Root Schema : schema
Type: object
Show Source
  • Translations file.

    Introduced in release 20.1.1.
  • links

    HATEOS link to related resources and actions or actions on this resource. Must include at least a 'self' link that contains a link to the canonical representation of the resource.

  • Import options. Specify whether to import the translations, or just validate the translation file and not import the translations. Defaults to import if not specified. Import will still fail if translations are not valid.

    Valid values are:

    • validate - Validate the site translations, but do not import. The job status resource
    will contain the results of the validation.
    • import - Import the site translations if they are valid. The job status resource
    will contain the results of the import.

    Introduced in release 20.1.1.
Example:
{
    "file":"path:packages/translations/AcmeProductLaunch_fr_de.zip",
    "options":"validate"
}
Nested Schema : links
Type: array

HATEOS link to related resources and actions or actions on this resource. Must include at least a 'self' link that contains a link to the canonical representation of the resource.

Show Source
Nested Schema : items
Match All
Show Source
  • Link
Back to Top

Response

202 Response

Accepted

400 Response

Bad Request
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : InvalidFileExceptionDetail
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 : InvalidFileExceptionDetail-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 (Invalid File)
{
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Invalid File",
    "status":"400",
    "detail":"File does not exist or the authenticated user or client application does not have access to the file.",
    "o:errorCode":"OCE-DOCS-001002",
    "file":{
        "id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
    }
}

401 Response

Unauthorized

409 Response

Conflict

413 Response

Payload Too Large

415 Response

Unsupported Media Type

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