Import Default Templates
/sites/management/api/v1/templates/_import
Imports the set of default templates, themes and components. When a service is first created there are no templates, themes or components available to use by a developer. A default set of templates, themes and components can be imported if required, for example, to give developers some ideas for how to create templates, themes and components. Site developers can then change or copy these default templates and produce their own templates for sites. If the default templates, themes and components already exist they will be overwritten. If the authenticated user does not have permissions to overwrite any of the template, theme or components, due to sharing permissions, the affected template import job will report the error, but other template import jobs can continue unaffected. Effectively calling this operation is the same as importing all the default template packages individually and then monitoring each job for each template package.
Introduced in release 19.4.1.
Authorization
To invoke this operation, the authenticated user or client application must have one of the following roles:
- CECDeveloperUser
- CECSitesAdministrator
- CECContentAdministrator
Import Templates
Templates that have been exported from another service can also be imported to compliment the default templates.
For more information, see Import a Template Package.
Getting the Progress of a Template Import Job
Progress of a template import can be monitored from the template job status resource.
For more information, see Get the Progress of a Template 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 Template Related Job.
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 - Default Templates Import Started
When the request is accepted the Location
header will reference a template job status resource that uses batching syntax to identify all the individual template import jobs created by this operation. The import default templates operation creates a single job per default template and the location header provides a way of reading all the job status details in one request. When each job is complete the imported template can be located using the links inside the template
field of each job status resource response.
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.
403Forbidden - Template Overwrite Denied
When a template is imported with conflict resolution of overwrite
, and the template already exists but the authenticated user does not have the rights to overwrite it.
Error Code
OCE-SITEMGMT-009048
Resolution - Share Template
The owner can add the user as a Manager of the template to allow the user to overwrite it.
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 |
name | Template name. |
owner | Template owner contact details. |
For detailed information about this exception detail type, consult the TemplateOverwriteDeniedExceptionDetail 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": "Template Overwrite Denied", "status": "403", "detail": "Template '{name}' already exists and cannot be overwritten.", "o:errorCode": "OCE-SITEMGMT-009048", "name": "CafeSupremo", "owner": { "displayName": "John Smith", "email": "jsmith@example.com", "userName": "jsmith" } }
Introduced in release 19.4.1.
403Forbidden - Template Overwrite In Trash
When a template is imported with conflict resolution of overwrite
, and the template already exists and is in trash.
Error Code
OCE-SITEMGMT-009110
Resolution - Permanently Delete Template
If you are the owner, permanently delete the template. If you are not the owner, ask the owner to permanently delete the template, and try again.
Resolution - Restore Template
If you are the owner, restore the template and try again.
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 |
name | Template name. |
owner | Template owner contact details. |
For detailed information about this exception detail type, consult the TemplateOverwriteInTrashExceptionDetail 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": "Template Overwrite In Trash", "status": "403", "detail": "Template '{name}' is in trash so cannot be overwritten.", "o:errorCode": "OCE-SITEMGMT-009110", "name": "CafeSupremo", "owner": { "displayName": "John Smith", "email": "jsmith@example.com", "userName": "jsmith" } }
Introduced in release 20.4.2.
403Forbidden - Theme Overwrite Denied
When a theme is imported with conflict resolution of overwrite
, and the theme already exists but the authenticated user does not have the rights to overwrite it.
Error Code
OCE-SITEMGMT-009049
Resolution - Share Theme
The owner can add the user as a Manager of the theme to allow the user to overwrite it.
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 |
name | Theme name. |
owner | Theme owner contact details. |
For detailed information about this exception detail type, consult the ThemeOverwriteDeniedExceptionDetail 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": "Theme Overwrite Denied", "status": "403", "detail": "Theme '{name}' already exists and cannot be overwritten.", "o:errorCode": "OCE-SITEMGMT-009049", "name": "CafeSupremoTheme", "owner": { "displayName": "John Smith", "email": "jsmith@example.com", "userName": "jsmith" } }
Introduced in release 19.4.1.
403Forbidden - Theme Overwrite In Trash
When a theme is imported with conflict resolution of overwrite
, and the theme already exists and is in trash.
Error Code
OCE-SITEMGMT-009109
Resolution - Permanently Delete Theme
If you are the owner, permanently delete the theme. If you are not the owner, ask the owner to permanently delete the theme, and try again.
Resolution - Restore Theme
If you are the owner, restore the theme and try again.
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 |
name | Theme name. |
owner | Theme owner contact details. |
For detailed information about this exception detail type, consult the ThemeOverwriteInTrashExceptionDetail 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": "Theme Overwrite In Trash", "status": "403", "detail": "Theme '{name}' is in trash so cannot be overwritten.", "o:errorCode": "OCE-SITEMGMT-009109", "name": "CafeSupremoTheme", "owner": { "displayName": "John Smith", "email": "jsmith@example.com", "userName": "jsmith" } }
Introduced in release 20.4.2.
403Forbidden - Component Overwrite Denied
When a component is imported with conflict resolution of overwrite
, and the component already exists but the authenticated user does not have the rights to overwrite it.
Error Code
OCE-SITEMGMT-009050
Resolution - Share Component
The owner can add the user as a manager of the component to allow the user to overwrite it.
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 |
name | Component name. |
owner | Component owner contact details. |
For detailed information about this exception detail type, consult the ComponentOverwriteDeniedExceptionDetail 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": "Component Overwrite Denied", "status": "403", "detail": "Component '{name}' already exists and cannot be overwritten.", "o:errorCode": "OCE-SITEMGMT-009050", "name": "ContentNavMenu", "owner": { "displayName": "John Smith", "email": "jsmith@example.com", "userName": "jsmith" } }
Introduced in release 19.4.1.
403Forbidden - Component Overwrite In Trash
When a component is imported with conflict resolution of overwrite
, and the component already exists and is in trash.
Error Code
OCE-SITEMGMT-009108
Resolution - Permanently Delete Component
If you are the owner, permanently delete the component. If you are not the owner, ask the owner to permanently delete the component, and try again.
Resolution - Restore Component
If you are the owner, restore the component and try again.
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 |
name | Component name. |
owner | Component owner contact details. |
For detailed information about this exception detail type, consult the ComponentOverwriteInTrashExceptionDetail 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": "Component Overwrite In Trash", "status": "403", "detail": "Component '{name}' is in trash so cannot be overwritten.", "o:errorCode": "OCE-SITEMGMT-009108", "name": "ContentNavMenu", "owner": { "displayName": "John Smith", "email": "jsmith@example.com", "userName": "jsmith" } }
Introduced in release 20.4.2.
403Forbidden - Sites Administrator Role Required
The Sites Administrator role is required to create resources of this type.
Error Code
OCE-SITEMGMT-009140
Resolution - Change Sites System Settings
Creation of sites, templates, themes and components can be restricted to sites administrators. Update the Sites System settings to allow creation of sites resources of this type by non admin users.
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 |
resourceType | Resource type that can only be created by Sites Administrators. Valid values are:
|
name | Name of resource being created, if available. |
For detailed information about this exception detail type, consult the SitesAdminRoleRequiredExceptionDetail 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": "Sites Administrator Role Required", "status": "403", "detail": "The Sites Administrator role is required to create resources of this type.", "o:errorCode": "OCE-SITEMGMT-009140", "resourceType": "site", "name": "value" }
Introduced in release 22.5.2.
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 - Starter Edition Asset Types Limit Reached
Starter edition asset types limit reached.
Error Code
OCE-SITEMGMT-009159
Resolution - Upgrade to Premium
Upgrade to Premium to access unlimited asset types.
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": "Starter Edition Asset Types Limit Reached", "status": "409", "detail": "Starter edition limits the number of asset types that can be created.", "o:errorCode": "OCE-SITEMGMT-009159" }
Introduced in release 23.2.2.
409Conflict - Invalid Taxonomy Version
Imported taxonomy version is lower than the existing taxonomy.
Error Code
OCE-SITEMGMT-009162
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 Taxonomy Version", "status": "409", "detail": "Imported taxonomy version is lower than the existing taxonomy.", "o:errorCode": "OCE-SITEMGMT-009162" }
Introduced in release 23.2.2.
Request
-
Prefer(optional): string
Request asynchronous processing of the request using a
respond-async
header value.
Response
202 Response
400 Response
401 Response
403 Response
-
allOf
TemplateOverwriteDeniedExceptionDetail
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
TemplateOverwriteDeniedExceptionDetail-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
-
name(optional):
string
Maximum Length:
242
Template name.
Introduced in release 19.4.1. -
owner(optional):
owner
Template owner contact details.
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.
Template owner contact details.
Introduced in release 19.4.1.-
allOf
UserContact
User contact details. Contains the display name and email address of a user.
User contact details. Contains the display name and email address of a user.
-
object
SingularResource
All singular resources include the properties of the singular resource definition. A singular resource includes a list of links that provide relationships to other resources, or in the case of the self link the resource itself.
-
object
UserContact-allOf[1]
object
All singular resources include the properties of the singular resource definition. A singular resource includes a list of links that provide relationships to other resources, or in the case of the self link the resource itself.
-
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.
object
-
displayName(optional):
string
Human-readable user display name.
-
email(optional):
string
Email address to use when sending email notifications.
-
userName(optional):
string
User login name. Typically the user email address is used as the user login name.
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.
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Template Overwrite Denied",
"status":"403",
"detail":"Template '{name}' already exists and cannot be overwritten.",
"o:errorCode":"OCE-SITEMGMT-009048",
"name":"CafeSupremo",
"owner":{
"displayName":"John Smith",
"email":"jsmith@example.com",
"userName":"jsmith"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Template Overwrite In Trash",
"status":"403",
"detail":"Template '{name}' is in trash so cannot be overwritten.",
"o:errorCode":"OCE-SITEMGMT-009110",
"name":"CafeSupremo",
"owner":{
"displayName":"John Smith",
"email":"jsmith@example.com",
"userName":"jsmith"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme Overwrite Denied",
"status":"403",
"detail":"Theme '{name}' already exists and cannot be overwritten.",
"o:errorCode":"OCE-SITEMGMT-009049",
"name":"CafeSupremoTheme",
"owner":{
"displayName":"John Smith",
"email":"jsmith@example.com",
"userName":"jsmith"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Theme Overwrite In Trash",
"status":"403",
"detail":"Theme '{name}' is in trash so cannot be overwritten.",
"o:errorCode":"OCE-SITEMGMT-009109",
"name":"CafeSupremoTheme",
"owner":{
"displayName":"John Smith",
"email":"jsmith@example.com",
"userName":"jsmith"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Component Overwrite Denied",
"status":"403",
"detail":"Component '{name}' already exists and cannot be overwritten.",
"o:errorCode":"OCE-SITEMGMT-009050",
"name":"ContentNavMenu",
"owner":{
"displayName":"John Smith",
"email":"jsmith@example.com",
"userName":"jsmith"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Component Overwrite In Trash",
"status":"403",
"detail":"Component '{name}' is in trash so cannot be overwritten.",
"o:errorCode":"OCE-SITEMGMT-009108",
"name":"ContentNavMenu",
"owner":{
"displayName":"John Smith",
"email":"jsmith@example.com",
"userName":"jsmith"
}
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Sites Administrator Role Required",
"status":"403",
"detail":"The Sites Administrator role is required to create resources of this type.",
"o:errorCode":"OCE-SITEMGMT-009140",
"resourceType":"site",
"name":"value"
}