Soft Delete a Component
/sites/management/api/v1/components/{id}
Soft delete the component. The folder that corresponds to the soft-deleted component will be moved to the trash folder of the owner of the component. A component that has been soft-deleted can be restored or hard deleted.
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
In Use Components
You cannot delete a component or layout if it is used by any template. site or site update, including templates, sites or updates in the trash.
Restoring a Deleted Component
A soft-deleted component can be restored by the owner or the user that deleted the component.
For more information, see Undelete a Soft-Deleted Component.
Permanently Deleting a Component
A soft-deleted component can be permanently deleted using a hard delete.
For more information, see Hard Delete a Component.
Path Alternative Identifiers
The default identifier for a Component resource is the Component Identifier. The Component resource supports alternative identifiers.
nameComponent Name
Instead of the component identifier, the component name can be used to uniquely identify a component in the resource path. The default resource path parameter for a component is the component identifier, but when working with components the human-readable component name is sometimes easier.
http://api.example.com/sites/management/api/v1/components/name:FooterBar
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.
204No Content - Soft Deleted
When the resource is deleted a 204
status code is returned.
Client Error Response Examples
This operation responds with following client error (4xx) responses with exception details in the response body. For a full list of response HTTP status codes and example bodies, consult the Response section of this operation.
403Forbidden - Component Operation Forbidden
Your sharing role within the component does not allow you to perform the operation.
Error Code
OCE-SITEMGMT-009055
Resolution - Change the Sharing Role
Change the role given to the authenticated user to the required role or higher.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
component | Component on which the operation is being performed. |
For detailed information about this exception detail type, consult the ComponentOperationForbiddenExceptionDetail 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 Operation Forbidden", "status": "403", "detail": "You do have a sharing role in this component, but your role does not allow you to use this operation.", "o:errorCode": "OCE-SITEMGMT-009055", "component": { "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8" } }
Introduced in release 19.4.1.
404Not Found - Component Not Found
The site component does not exist or has been deleted, or the authenticated user or client application does not have access to the component.
Error Code
OCE-SITEMGMT-009045
Resolution - Check Identifier
Check that the component identifier is valid.
Resolution - Check Membership
Check that the authenticated user is a member of the component.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
component | Component that does not exist or is not visible to the authenticated user. |
For detailed information about this exception detail type, consult the ComponentNotFoundExceptionDetail 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 Not Found", "status": "404", "detail": "Component does not exist or has been deleted, or the authenticated user or client application does not have access to the component.", "o:errorCode": "OCE-SITEMGMT-009045", "component": { "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8" } }
Introduced in release 19.4.1.
409Conflict - Component In Use
The component is in use by one or more sites, templates or asset types. and cannot be deleted.
Error Code
OCE-SITEMGMT-009057
Resolution - Hard Delete Site
Hard delete the site that is associated with the component.
Resolution - Hard Delete Template
Hard delete the template that is associated with the component.
Resolution - Remove Component Usage From the Template or Site
Remove the component from the site or template that is using the component.
Exception Detail Fields
This error type includes the following fields/values in the response:
Field Name | Description |
component | Component that cannot be deleted because it is in use. |
templates | Templates that use the component. |
sites | Sites that use the component. |
usedBy | Site resources that are using the component. |
For detailed information about this exception detail type, consult the ComponentInUseExceptionDetail 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 In Use", "status": "409", "detail": "Component cannot be deleted because it is being used by one or more sites, templates or asset types.", "o:errorCode": "OCE-SITEMGMT-009057", "component": { "id": "F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8" }, "templates": [ { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } ], "sites": [ { "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0" } ], "usedBy": { "sites": [ { "name": "MyNewProduct", "site": { "id": "FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0" } } ], "templates": [ { "name": "CafeSupremo", "template": { "id": "F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6" } } ], "types": [ { "name": "value", "type": { "name": "Video" } } ], "translationConnectors": [ { "name": "value" } ], "sitePlans": [ { "name": "value" } ] } }
Introduced in release 19.4.1.
Request
-
id: string
Immutable identifier for the component.
Response
204 Response
400 Response
401 Response
403 Response
-
allOf
ComponentOperationForbiddenExceptionDetail
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
ComponentOperationForbiddenExceptionDetail-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
-
component(optional):
string
Component 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":"Component Operation Forbidden",
"status":"403",
"detail":"You do have a sharing role in this component, but your role does not allow you to use this operation.",
"o:errorCode":"OCE-SITEMGMT-009055",
"component":{
"id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
}
}
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.
-
allOf
ComponentNotFoundExceptionDetail
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
ComponentNotFoundExceptionDetail-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
-
component(optional):
string
Component that does not exist or is not visible to the authenticated user.
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":"Component Not Found",
"status":"404",
"detail":"Component does not exist or has been deleted, or the authenticated user or client application does not have access to the component.",
"o:errorCode":"OCE-SITEMGMT-009045",
"component":{
"id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
}
}
409 Response
-
allOf
ComponentInUseExceptionDetail
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
ComponentInUseExceptionDetail-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
-
component(optional):
string
Component that cannot be deleted because it is in use.
Introduced in release 19.4.1. -
sites(optional):
array sites
Sites that use the component.
Introduced in release 19.4.1. -
templates(optional):
array templates
Templates that use the component.
Introduced in release 19.4.1. -
usedBy(optional):
object usedBy
Site resources that are using the component.
Introduced in release 22.6.2.
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.
array
Sites that use the component.
Introduced in release 19.4.1.array
Templates that use the component.
Introduced in release 19.4.1.object
Site resources that are using the component.
Introduced in release 22.6.2.-
sitePlans(optional):
array sitePlans
Site plans.
Introduced in release 23.6.1. -
sites(optional):
array sites
Sites
Introduced in release 22.6.2. -
templates(optional):
array templates
Templates
Introduced in release 22.6.2. -
translationConnectors(optional):
array translationConnectors
Translation connectors.
Introduced in release 22.8.2. -
types(optional):
array types
Content Types.
Introduced in release 22.6.2.
array
Translation connectors.
Introduced in release 22.8.2.object
-
name:
string
Site plan name.
Introduced in release 23.6.1.
object
-
name:
string
Maximum Length:
242
Site name
Introduced in release 22.6.2. -
site:
string
Associated site resource.
Introduced in release 22.6.2.
object
-
name:
string
Maximum Length:
242
Template name
Introduced in release 22.6.2. -
template:
string
Associated template resource.
Introduced in release 22.6.2.
object
-
name:
string
Tranlsation connector name.
Introduced in release 22.8.2.
object
-
name:
string
Content type name.
Introduced in release 22.7.2. -
type:
string
Associated content type resource.
Introduced in release 22.7.2.
{
"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"title":"Component In Use",
"status":"409",
"detail":"Component cannot be deleted because it is being used by one or more sites, templates or asset types.",
"o:errorCode":"OCE-SITEMGMT-009057",
"component":{
"id":"F40B9BE3E69F6DC440559A1F033BB2482DB740ECB2D8"
},
"templates":[
{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
],
"sites":[
{
"id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
}
],
"usedBy":{
"sites":[
{
"name":"MyNewProduct",
"site":{
"id":"FCA9C0E5CDCB549A19FFB85987A2352778961003B8A0"
}
}
],
"templates":[
{
"name":"CafeSupremo",
"template":{
"id":"F30F08EB205D44AD20B5A48D1B1B3DD7D74F45978AB6"
}
}
],
"types":[
{
"name":"value",
"type":{
"name":"Video"
}
}
],
"translationConnectors":[
{
"name":"value"
}
],
"sitePlans":[
{
"name":"value"
}
]
}
}