Export a Template
/sites/management/api/v1/templates/{id}/export
Export a template as a template package. The template, associated theme and components are exported to a template package file and stored as a file under the users home folder. The location of this file defaults to the home folder of the authenticated user, but a explicit folder can be specified. If an explicit folder is specified the authenticated user or client application must have permission to create files in that folder. The name of the exported template package file is the template name with a zip file extension. Repeated calls to export the same template will create new revisions of the file; the latest revision being the latest request to export the template.
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
- Contributor
- Downloader
Importing a Template
An exported template can be imported by providing the exported template package file.
For more information, see Import a Template Package.
Asynchronous Processing
This operation supports both asynchronous and synchronous processing. The client can specify a preferred interaction mode by adding a Prefer
header with a value of respond-async
. The server may change an asynchronous request to synchronous so the client should be prepared to handle both cases. 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.
Path Alternative Identifiers
The default identifier for a Template resource is the Template Identifier. The Template resource supports alternative identifiers.
nameTemplate Name
Instead of the template identifier, the template name can be used to uniquely identify a template in the resource path. The default resource path parameter for a template is the template identifier, but when working with templates the human-readable template name is sometimes easier.
http://api.example.com/sites/management/api/v1/templates/name:CafeSupremo/export
Introduced in release 19.4.1.
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.
pathFolder Path
The default identifier for a Folder resource is the Item Identifier.
Instead of the folder identifier the folder path can be used to identify a folder. A path
is built up using the names of the parent folder (relative to the user's home folder),
joined by /
. Folder paths can only be used for personal folders, shared folders cannot be referenced by path.
Folder and file names are case insensitive.
path:folder1/folder2
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.
202Accepted - Asynchronous Export to Home Folder
Export the template into the home folder of the authenticated user.
Request
POST https://api.example.com/sites/management/api/v1/templates/{id}/export
Request Headers
Prefer=respond-async
202Accepted - Asynchronous Export to Explicit Folder
Export the template into the folder packages\templates
under the authenticated user or client application home folder.
Request
POST https://api.example.com/sites/management/api/v1/templates/{id}/export
Request Headers
Prefer=respond-async
Request Body
"path:packages/templates"
202Accepted - Asynchronous Export to Explicit Folder Identifier
Export the template into a folder identified by the folder identifier.
Request
POST https://api.example.com/sites/management/api/v1/templates/{id}/export
Request Headers
Prefer=respond-async
Request Body
"F04703DB9F17EECBD1C41A4EF6C3FF17C1177A968060"
Redirection Response Examples
This operation responds with the following redirection (3xx) responses. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation. Note: Depending on the client technology used to invoke this operation a 2xx response may be returned if the redirection is followed automatically.
303See Other - Synchronous Export to Home Folder
Export the template into the home folder of the authenticated user.
Request
POST https://api.example.com/sites/management/api/v1/templates/{id}/export
303See Other - Synchronous Export to Explicit Folder
Export the template into the folder packages\templates
under the authenticated user or client application home folder.
Request
POST https://api.example.com/sites/management/api/v1/templates/{id}/export
Request Body
"path:packages/templates"
303See Other - Synchronous Export to Explicit Folder Identifier
Export the template into a folder identified by the folder identifier.
Request
POST https://api.example.com/sites/management/api/v1/templates/{id}/export
Request Body
"F04703DB9F17EECBD1C41A4EF6C3FF17C1177A968060"
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 Folder
A folder identified with an identifier cannot be found.
Error Code
OCE-DOCS-001003
Resolution - Check Folder Exists
Check that the folder identifier is valid.
Resolution - Check Sharing Role in Folder
Check that the authenticated user or client application has a role for the folder.
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 |
folder | Folder that does not exist. |
For detailed information about this exception detail type, consult the InvalidFolderExceptionDetail 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 Folder", "status": "400", "detail": "Folder does not exist or the authenticated user or client application does not have access to the folder.", "o:errorCode": "OCE-DOCS-001003", "folder": { "id": "FC274A0A4E18CD651C0EDD7DT0000DEFAULT00000000" } }
Introduced in release 19.4.1.
403Forbidden - Template Operation Forbidden
Your sharing role within the template does not allow you to perform the operation.
Error Code
OCE-SITEMGMT-009053
Resolution - Change the Sharing Role
Change the sharing role given to the authenticated user to the required role or higher.
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 |
template | Template on which the operation is being performed. |
For detailed information about this exception detail type, consult the TemplateOperationForbiddenExceptionDetail 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 Operation Forbidden", "status": "403", "detail": "You do have a sharing role in this template, but your role does not allow you to use this operation.", "o:errorCode": "OCE-SITEMGMT-009053", "template": { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } }
Introduced in release 19.4.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 can 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.
403Forbidden - Quota Size Exceeded
Quota limit has been reached. Limits have been set by the system administrator.
Error Code
OCE-SITEMGMT-009142
Resolution - Increase Quota
Get a system administrator to increase the user's quota.
Where This Error Can be Returned
- This error can 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 | Used quota, in Bytes. |
total | Quota limit, in Bytes. |
For detailed information about this exception detail type, consult the QuotaSizeExceededExceptionDetail 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": "Quota Size Exceeded", "status": "403", "detail": "Quota size exceeded.", "o:errorCode": "OCE-SITEMGMT-009142", "used": 1234567890, "total": 1234567890 }
Introduced in release 22.8.2.
404Not Found - Template Not Found
The site template does not exist or has been deleted, or the authenticated user or client application does not have access to the template.
Error Code
OCE-SITEMGMT-009000
Resolution - Check Identifier
Check that the template identifier is valid.
Resolution - Check Membership
Check that the authenticated user is a member of the template or a site administrator.
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 |
template | Template that does not exist or is not visible to the authenticated user. |
For detailed information about this exception detail type, consult the TemplateNotFoundExceptionDetail 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 Not Found", "status": "404", "detail": "Template does not exist or has been deleted, or the authenticated user or client application does not have access to the template.", "o:errorCode": "OCE-SITEMGMT-009000", "template": { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } }
409Conflict - Template Deleted
The operation cannot be performed on a soft deleted template. This error can only occur when the includeDeleted
query parameter set to true
Error Code
OCE-SITEMGMT-009061
Resolution - Restore Template
Restore the template and then try the operation 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 |
template | Template that is soft deleted. |
For detailed information about this exception detail type, consult the TemplateDeletedExceptionDetail 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 Deleted", "status": "409", "detail": "The operation cannot be performed as the template has been soft deleted.", "o:errorCode": "OCE-SITEMGMT-009061", "template": { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } }
Introduced in release 19.4.1.
Request
- application/json
-
id: string
Immutable identifier for the template.
-
includeDeleted(optional): boolean
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 theincludeDeleted
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.
-
Prefer(optional): string
Request asynchronous processing of the request using a
respond-async
header value.
A folder the authenticated owns or a folder the authenticated user or client application has the manager or contributor role in. If no folder is specified then the template file is written into the home folder of the authenticated user or client application.
string
"path:packages/templates"
Response
202 Response
303 Response
400 Response
-
allOf
InvalidFolderExceptionDetail
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
InvalidFolderExceptionDetail-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
-
folder(optional):
string
Folder 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 Folder",
"status":"400",
"detail":"Folder does not exist or the authenticated user or client application does not have access to the folder.",
"o:errorCode":"OCE-DOCS-001003",
"folder":{
"id":"FC274A0A4E18CD651C0EDD7DT0000DEFAULT00000000"
}
}
401 Response
403 Response
-
allOf
TemplateOperationForbiddenExceptionDetail
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
TemplateOperationForbiddenExceptionDetail-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
-
template(optional):
string
Template on which the operation is being performed.
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":"Template Operation Forbidden",
"status":"403",
"detail":"You do have a sharing role in this template, but your role does not allow you to use this operation.",
"o:errorCode":"OCE-SITEMGMT-009053",
"template":{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
}
{
"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
}
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Quota Size Exceeded",
"status":"403",
"detail":"Quota size exceeded.",
"o:errorCode":"OCE-SITEMGMT-009142",
"used":1234567890,
"total":1234567890
}
404 Response
-
Cache-Control: string
Directives for caching mechanisms.
-
Content-Length: string
Size of the response body.
-
Content-Type: string
Content type of the response.
-
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
TemplateNotFoundExceptionDetail-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
-
template(optional):
string
Template that does not exist or is not visible to the authenticated user.
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":"Template Not Found",
"status":"404",
"detail":"Template does not exist or has been deleted, or the authenticated user or client application does not have access to the template.",
"o:errorCode":"OCE-SITEMGMT-009000",
"template":{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
}
409 Response
-
allOf
TemplateDeletedExceptionDetail
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
TemplateDeletedExceptionDetail-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
-
template(optional):
string
Template that is soft deleted.
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":"Template Deleted",
"status":"409",
"detail":"The operation cannot be performed as the template has been soft deleted.",
"o:errorCode":"OCE-SITEMGMT-009061",
"template":{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
}