Persist classification nodes
| /pim/nodes/persist Saves nodes structure. Several nodes could be persisted. |
Resource path |
/api/core/v1/pim/nodes/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
| API restriction for users without admin role - endpoint is not available. |
Body parameters
Accepts PimType with ClassificationNodesType
Return Type
PimType with statuses ResponsesType about each persisted node.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with responses |
|
500 |
Error in ResponseType |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Create a node
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/pim/nodes/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml; charset=UTF-8;' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node
parentId="123"
tid="Accessories">
<name>
<itm loc="en_EN">Accessories EN</itm>
<itm loc="de_DE">Accessories DE</itm>
<itm loc="fr_FR">Accessories FR</itm>
</name>
</node>
</nodes>
</pim>'
Request body. By parent id
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node
parentId="123"
tid="Accessories">
<name>
<itm loc="en_EN">Accessories EN</itm>
<itm loc="de_DE">Accessories DE</itm>
<itm loc="fr_FR">Accessories FR</itm>
</name>
</node>
</nodes>
</pim>
Request body. By parent path
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node
parentPath="/Standard/Bekleidung"
tid="Accessories">
<name>
<itm loc="en_EN">Accessories EN</itm>
<itm loc="de_DE">Accessories DE</itm>
<itm loc="fr_FR">Accessories FR</itm>
</name>
</node>
</nodes>
</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-10-21T08:22:23.363Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="create"
dataType="classNode"
id="110140"
path="/Standard/Bekleidung/Accessories"
tid="Accessories">
<status>SUCCESS</status>
<description>Node has been saved</description>
</response>
</responses>
</pim>
Create a root node
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/pim/nodes/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml; charset=UTF-8;' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node
classificationTid="Standart"
tid="Standart">
<name>
<itm loc="en_EN">Standart EN</itm>
<itm loc="de_DE">Standart DE</itm>
</name>
</node>
</nodes>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node
classificationTid="Standart"
tid="Standart">
<name>
<itm loc="en_EN">Standart EN</itm>
<itm loc="de_DE">Standart DE</itm>
</name>
</node>
</nodes>
</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-10-21T08:22:23.363Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="create"
dataType="classNode"
id="11040"
path="/Standard"
tid="Standart">
<status>SUCCESS</status>
<description>Node has been saved</description>
</response>
</responses>
</pim>
Update a node
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/pim/nodes/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml; charset=UTF-8;' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node path="/Standard" tid="Standard">
<name>
<itm loc="en_EN">Standard EN 1</itm>
<itm loc="fr_FR">Standard FR 1</itm>
</name>
</node>
</nodes>
</pim>'
Several nodes could be persisted.
Request body. By path
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node path="/Standard" tid="Standard">
<name>
<itm loc="en_EN">Standard EN 1</itm>
<itm loc="fr_FR">Standard FR 1</itm>
</name>
</node>
</nodes>
</pim>
Request body. By id
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<nodes>
<node id="654332" tid="Standard">
<name>
<itm loc="en_EN">Standard EN 1</itm>
<itm loc="fr_FR">Standard FR 1</itm>
</name>
</node>
</nodes>
</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-10-21T08:22:23.363Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="update"
dataType="classNode"
id="654332"
path="/Standard"
tid="Standart">
<status>SUCCESS</status>
<description>Node has been saved</description>
</response>
</responses>
</pim>
Error responses
Creation. No parent node 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-11-04T13:56:20.501Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="create" dataType="classNode" tid="AAAA12">
<status>ERROR</status>
<description>An error occurred while node creation. Parent node path: null, or id: 1147412, node: AAAA12, the reason: Node with id 1147412 does not exist.</description>
</response>
</responses>
</pim>
Creation. No parent node by path
<?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-11-04T13:56:20.501Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="create" dataType="classNode" tid="AAAA11">
<status>ERROR</status>
<description>An error occurred while node creation. Parent node path: /Root/node1, or id: null, node: AAAA11, the reason: Node with path '[Root, node1]' does not exist.</description>
</response>
</responses>
</pim>
Update. No node 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-11-04T13:57:20.483Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="update"
dataType="classNode"
id="1147423"
path="/Standard/AAAA1/AAAA12"
tid="AAAA12">
<status>ERROR</status>
<description>Node with id 1147423 does not exist.</description>
</response>
</responses>
</pim>
Update. No node by path
<?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-11-04T13:57:20.483Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="update"
dataType="classNode"
path="/Standard/AAAA1/AAAA12/Gürtel"
tid="Gürtel">
<status>ERROR</status>
<description>Node with path '[Standard, AAAA1, AAAA12, Gürtel]' does not exist.</description>
</response>
</responses>
</pim>
No access to the endpoint
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://www.apollon.de/omn">
<details>
<itm key="supportId">bb58d0b5-231a-4097-bd05-9c447615899c</itm>
</details>
<issues>
<itm key="code">1010</itm>
<itm key="description">Access to the requested resource endpoint is forbidden</itm>
<itms type="details">
<itm key="errorMessage">Nodes persist API is restricted for users</itm>
</itms>
</issues>
<status>ERROR</status>
</response>
No classification by identifier
<?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-11-04T13:48:55.442Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="create" dataType="classNode" tid="AAAA111">
<status>ERROR</status>
<description>An error occurred while node creation. Parent node path: null, or id: null, node: AAAA111, the reason: No classification by name: Standard1</description>
</response>
</responses>
</pim>