Perform classifications
| /pim/classes/perform Deletes classifications and classification nodes with attributes. |
Resource path |
/api/core/v1/pim/classes/perform |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Body parameters
Accepts PimType with ActionsType.
| The API consumer should provide one of the classification identifiers tid or id to perform action/s on the classification. |
| Actions are performed by tid if both tid and id parameters are present in the request. |
Return Type
PimType with statuses ResponsesType about each persisted classification.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
1. Delete classification by tid
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/perform' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<actions>
<action dataType="classification"
tid="Classification"
type="delete"/>
</actions>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<actions>
<action dataType="classification"
tid="Classification"
type="delete"/>
</actions>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-22T03:19:45.983Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="classification" tid="Classification">
<description>The classification has been deleted successfully</description>
<status>SUCCESS</status>
</response>
</responses>
</pim>
2. Delete classification by id
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/perform' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<actions>
<action dataType="classification"
id="24101"
type="delete"/>
</actions>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<actions>
<action dataType="classification"
id="24101"
type="delete"/>
</actions>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-22T03:25:07.523Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="classification" id="24101">
<description>The classification has been deleted successfully</description>
<status>SUCCESS</status>
</response>
</responses>
</pim>
Error response examples
Classification not found by id
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-22T03:27:01.713Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="classification" id="241001">
<description>The classification not found by given id: '241001'</description>
<status>ERROR</status>
</response>
</responses>
</pim>
Classification not found by tid
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-22T03:28:25.751Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="classification" tid="ClassificationNotExists">
<description>The classification not found by given tid: 'ClassificationNotExists'</description>
<status>ERROR</status>
</response>
</responses>
</pim>
Wrong data type
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-22T03:31:16.094Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="classification" tid="Classification">
<description>The data type of the passed item is wrong. It must be 'classification'</description>
<status>ERROR</status>
</response>
</responses>
</pim>
Missing tid and id request attributes
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-22T03:31:57.779Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="classification">
<description>Classification attributes missing: 'tid' or 'id' attribute must be</description>
<status>ERROR</status>
</response>
</responses>
</pim>