Import Default Templates

post

/sites/management/api/v1/templates/_import

EXTENDED OPERATION

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 NameDescription
nameTemplate name.
ownerTemplate 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 NameDescription
nameTemplate name.
ownerTemplate 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 NameDescription
nameTheme name.
ownerTheme 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 NameDescription
nameTheme name.
ownerTheme 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 NameDescription
nameComponent name.
ownerComponent 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 NameDescription
nameComponent name.
ownerComponent 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 NameDescription
resourceTypeResource type that can only be created by Sites Administrators. Valid values are:
  • site - Site resource
  • template - Template resource
  • theme - Theme resource
  • component - Component resource
nameName 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 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 - 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

Header Parameters
Back to Top

Response

202 Response

Accepted

400 Response

Bad Request

401 Response

Unauthorized

403 Response

Forbidden
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : TemplateOverwriteDeniedExceptionDetail
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 : TemplateOverwriteDeniedExceptionDetail-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.

Nested Schema : owner

Template owner contact details.

Introduced in release 19.4.1.
Match All
Show Source
  • UserContact

    User contact details. Contains the display name and email address of a user.

Nested Schema : UserContact

User contact details. Contains the display name and email address of a user.

Match All
Show Source
  • 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.

  • UserContact-allOf[1]
Nested Schema : SingularResource
Type: 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.

Show Source
  • links
Nested Schema : UserContact-allOf[1]
Type: object
Show Source
Example Response (Template Overwrite Denied)
{
    "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"
    }
}
Example Response (Template Overwrite In Trash)
{
    "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"
    }
}
Example Response (Theme Overwrite Denied)
{
    "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"
    }
}
Example Response (Theme Overwrite In Trash)
{
    "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"
    }
}
Example Response (Component Overwrite Denied)
{
    "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"
    }
}
Example Response (Component Overwrite In Trash)
{
    "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"
    }
}
Example Response (Sites Administrator Role Required)
{
    "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"
}

409 Response

Conflict

413 Response

Payload Too Large

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