Import Site Translations
/sites/management/api/v1/sites/_importTranslations
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 Name | Description |
file | File 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 Name | Description |
site | Site 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 Name | Description |
repository | Repository 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 Name | Description |
used | Storage used, in GB. |
limit | Storage 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 Name | Description |
site | Site 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
- application/json
-
Prefer(optional): string
Request asynchronous processing of the request using a
respond-async
header value.
Specify the translation file to import, and whether to do validation only.
object
-
file:
string
Translations file.
Introduced in release 20.1.1. -
links(optional):
array 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.
-
options(optional):
string
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
-
import
- Import the site translations if they are valid. The job status resource
-
{
"file":"path:packages/translations/AcmeProductLaunch_fr_de.zip",
"options":"validate"
}
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.
object
REST HATEOAS link and related metadata. If responses provide links (for example, a self
link to the resource itself) the links provided will include one or more of the properties defined on this link structure.
-
href(optional):
string
The target resource URI. URI RFC3986 or URI Template RFC6570. If the value is set to URI Template, then the
templated
property must be set totrue
. -
mediaType(optional):
string
Media type, as defined by RFC 2046, describing the link target.
-
method(optional):
string
HTTP method for requesting the target of the link.
Valid values are:
-
OPTIONS
- HTTP OPTIONS -
HEAD
- HTTP HEAD -
GET
- HTTP GET -
POST
- HTTP POST -
PUT
- HTTP PUT -
PATCH
- HTTP PATCH -
DELETE
- HTTP DELETE
-
-
profile(optional):
string(uri)
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource.
-
rel(optional):
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details.
-
templated(optional):
boolean
Boolean flag that specifies the
href
property is a URI or URI Template. The property can be assumed to befalse
if the property is not present.
Response
202 Response
400 Response
-
allOf
InvalidFileExceptionDetail
Introduced in release 19.4.1.
-
object
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.
-
object
InvalidFileExceptionDetail-allOf[1]
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.
-
detail(optional):
string
Description specific to this occurrence of the problem. The human-readable, potentially multi-line details describing the problem in more details.
-
instance(optional):
string(uri)
URI to the link that provides more detail about the error.
-
o:errorCode(optional):
string
Application error code, which is different from HTTP error code. This code should be used to check for specific errors, rather than comparing fields such as the
title
ordetail
. -
o:errorDetails(optional):
array o:errorDetails
Multiple errors can be organized in a hierarchical structure.
-
o:errorPath(optional):
string
XPath or JSON path to indicate where the error occurs.
-
status(optional):
integer(int32)
Corresponding HTTP status code for the error.
-
title(optional):
string
Short, human-readable summary of the problem. It is not advisable to use the title as a way of checking for specific errors, use the
o:errorCode
for this purpose. -
type(optional):
string(uri)
Absolute URI that identifies the problem type. When this URI dereferenced, it should provide a human-readable summary of the problem, for example, as a HTML page.
object
-
file(optional):
string
File that does not exist.
Introduced in release 19.4.1.
array
Multiple errors can be organized in a hierarchical structure.
-
object
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.
{
"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"
}
}