Persist peos
| /peo/peos/persist Creates or updates PEOs. |
Allow to
-
Create peo
-
Update peo
Resource path |
/api/core/v1/peo/peos/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Return Type
PimType with statuses ResponsesType about each persisted peo.
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
1. Create peo linked to product
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/peo/peos/persist \
--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">
<peos>
<peo productTid="ec98dde6-4064-465d-a1fb-237e2f10a336" templateId="47220">
<name>PEO name3</name>
</peo>
</peos>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<peos>
<peo productTid="ec98dde6-4064-465d-a1fb-237e2f10a336" templateId="47220">
<name>PEO name</name>
</peo>
</peos>
</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">2023-02-27T12:23:02.746Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="peo" id="52730">
<status>SUCCESS</status>
<description>PEO has been saved successfully</description>
</response>
</responses>
</pim>
2. Create peo linked to product and projects
During creation peo can be linked to several projects, which tids and ids contains in request.
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/peo/peos/persist \
--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">
<peos>
<peo productTid="tid1" templateId="1">
<name>PEO name</name>
<nodes>
<node>projectTid1</node>
<node>projectTid2</node>
<node tid="projectTid3"/>
<node id="1"/>
</nodes>
</peo>
</peos>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<peos>
<peo productTid="ec98dde6-4064-465d-a1fb-237e2f10a336" templateId="47220">
<name>PEO name</name>
<nodes>
<node>projectTid1</node>
<node>projectTid2</node>
<node tid="projectTid3"/>
<node id="1"/>
</nodes>
</peo>
</peos>
</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">2023-02-27T12:23:02.746Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="peo" id="52730">
<status>SUCCESS</status>
<description>PEO has been saved successfully</description>
</response>
</responses>
</pim>
3. Update peo
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/peo/peos/persist \
--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">
<peos>
<peo productTid="55beafb6-a80b-48ab-8a7b-9e1a98d67b24">
<name>PEO new name</name>
</peo>
</peos>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<peos>
<peo productTid="55beafb6-a80b-48ab-8a7b-9e1a98d67b24">
<name>PEO new name</name>
</peo>
</peos>
</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">2023-02-27T13:50:44.539Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="peo">
<description>Peo has been saved successfully</description>
<status>SUCCESS</status>
</response>
</responses>
</pim>
Error responses
Product not found
<?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-07-06T11:49:25.214Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="peo" action="update">
<status>ERROR</status>
<description>Product not found</description>
</response>
</responses>
</pim>
Peo template not found
<?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-07-06T11:49:25.214Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="peo" action="update">
<status>ERROR</status>
<description>PEO template has not been found</description>
</response>
</responses>
</pim>