Classifications API
Provides operations on OMN classifications.
GET /pim/classes
| /pim/classes Get classifications. Operation Id:: getClasses |
get classes
Retrieve classifications
| /pim/classes/retrieve Retrieve classifications information without or with nodes and nodes attributes. |
The endpoint could provide information about classifications, nodes and nodes attributes.
Resource path |
/api/core/v1/pim/classes/retrieve |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
|
Body parameters
Specified by ClassificationRequest
-
ids: it might be used to get classifications by id's
-
tids: it might be used to get classifications by tid's
-
withNodes: it might be used to get classifications with nodes
-
flatNodes: it might be used to get classification nodes in flat structure. By default parameter value is true.
|
Return Type
PimType with filled ClassificationsType. More info ClassificationType
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ClassificationsType |
|
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. To get a list of classifications by tids without nodes
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/xml (or application/json)' \
--data-raw '{
"tids":["Standard", "Standart"]
}'
{
"tids":["Standard", "Standart"]
}
<?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-21T08:44:09.377Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Standard">
<name/>
</class>
<class tid="Standart">
<name/>
</class>
</classes>
</pim>
{
"meta": {
"messageType": "request",
"messageTime": "2022-12-21T08:44:09.377Z",
"sourceEnv": "web",
"itemInformationType": "classification"
},
"classes": {
"entries": [
{
"name": {},
"tid": "Standard"
},
{
"name": {},
"tid": "Standart"
}
]
},
"schemaVersion": "5.6.0"
}
2. To get a list of classifications by ids without nodes
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/xml (or application/json)' \
--data-raw '{
"ids":[15360, 1]
}'
{
"ids":[15360, 1]
}
<?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-21T08:48:01.469Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Standard">
<name/>
</class>
<class tid="Standart">
<name/>
</class>
</classes>
</pim>
{
"meta": {
"messageType": "request",
"messageTime": "2022-12-21T08:44:09.377Z",
"sourceEnv": "web",
"itemInformationType": "classification"
},
"classes": {
"entries": [
{
"name": {},
"tid": "Standard"
},
{
"name": {},
"tid": "Standart"
}
]
},
"schemaVersion": "5.6.0"
}
3. To get a list of classifications by tids with nodes and attributes in flat structure
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"tids":["Standard"],
"withNodes":true
}'
{
"tids":["Standard"],
"withNodes":true
}
<?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-21T09:06:52.939Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Standard">
<name/>
</class>
</classes>
<nodes>
<node class="Standard" id="15370" path="/Standard">
<name/>
<attr inheritance="visible"
key="gender"
level="p"
localized="true"
restriction="optional">
<domainVals allowNewValue="false" sortDirection="MANUAL">
<domainVal tid="female">
<itm loc="en_EN">female</itm>
<itm loc="de_DE">weiblich</itm>
</domainVal>
</domainVals>
</attr>
</node>
<node class="Standard"
id="15371"
parentId="15370"
parentPath="/Standard"
path="/Standard/Bekleidung">
<name/>
</node>
</nodes>
</pim>
4. To get a list of classifications by tids with nodes and attributes in tree structure
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"tids":["Standard"],
"withNodes":true,
"flatNodes": false
}'
{
"tids":["Standard"],
"withNodes":true,
"flatNodes": false
}
<?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-21T09:15:21.161Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Standard">
<name/>
<node class="Standard" id="15370" path="/Standard">
<name/>
<attr inheritance="visible"
key="gender"
level="p"
localized="true"
restriction="optional">
<domainVals allowNewValue="false" sortDirection="MANUAL">
<domainVal tid="female">
<itm loc="en_EN">female</itm>
<itm loc="de_DE">weiblich</itm>
</domainVal>
</domainVals>
</attr>
<node class="Standard"
id="15371"
parentId="15370"
parentPath="/Standard"
path="/Standard/Bekleidung">
<name/>
</node>
</node>
</class>
</classes>
</pim>
5. To get a list of all classifications
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
}'
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"tids": []
}'
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"ids": []
}'
{
}
{
"tids": []
}
{
"ids": []
}
<?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-21T09:24:29.058Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Standart">
<name/>
</class>
<class tid="Standard">
<name/>
</class>
</classes>
</pim>
Persist classifications
| /pim/classes/persist Saves classifications and classification nodes with attributes. |
Allow to
-
Create classification
-
Update classification
-
Create classification nodes and nodes attributes
-
Update classification nodes and nodes attributes
Resource path |
/api/core/v1/pim/classes/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Body parameters
Accepts PimType with ClassificationsType and ClassificationNodesType.
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. Create a classification without nodes and attributes
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/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">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-12-05T11:38:06.882Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="NewClassification">
</class>
</classes>
</pim>'
<?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-05T11:38:06.882Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="NewClassification">
</class>
</classes>
</pim>
<?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-05T11:38:06.882Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="create" tid="NewClassification">
<status>SUCCESS</status>
<description>The classification has been created successfully</description>
</response>
</responses>
</pim>
2. Create or update a classification with localizations, nodes and attributes
| A Classification must have a root node which name equals classification name. At First a root node must be created. After that the remaining nodes must be created. |
| Nodes are created/updated strictly in turn, as specified in the request. |
| A Root node does not have a parent node. |
| Be precise with classification tid values. A Classification will be created if it is not found by tid. |
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/classes/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">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-11-17T03:22:30.207Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Classification">
<name>
<itm loc="en_GB">Class_en</itm>
<itm loc="de_DE">Class_de</itm>
</name>
<meta>
...
</meta>
</class>
</classes>
<nodes>
<node class="Classification" id="00000" path="/Classification">
<attr key="product_id"
level="p"
inheritance="visible"
restriction="optional"
localized="false"/>
</node>
<node class="Classification" id="00001" parentId="00000" path="/Classification/node" parentPath="/Classification">
<attr key="product_title"
level="p"
inheritance="visible"
restriction="optional"
localized="true"/>
</node>
<node class="Classification" id="00002" parentId="00001" path="/Classification/node/node1" parentPath="/Classification/node">
<attr key="description_long"
level="p"
inheritance="visible"
restriction="optional"
localized="true"/>
</node>
</nodes>
</pim>'
<?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-17T03:22:30.207Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<classes>
<class tid="Classification">
<name>
<itm loc="en_GB">Class_en</itm>
<itm loc="de_DE">Class_de</itm>
</name>
<meta>
...
</meta>
</class>
</classes>
<nodes>
<node class="Classification" id="00000" path="/Classification">
<attr key="product_id"
level="p"
inheritance="visible"
restriction="optional"
localized="false"/>
</node>
<node class="Classification" id="00001" parentId="00000" path="/Classification/node" parentPath="/Classification">
<attr key="product_title"
level="p"
inheritance="visible"
restriction="optional"
localized="true"/>
</node>
<node class="Classification" id="00002" parentId="00001" path="/Classification/node/node1" parentPath="/Classification/node">
<attr key="description_long"
level="p"
inheritance="visible"
restriction="optional"
localized="true"/>
</node>
</nodes>
</pim>
<?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-17T03:22:30.207Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="create" tid="NewClassification">
<status>SUCCESS</status>
<description>The classification has been created successfully</description>
</response>
</responses>
</pim>
<?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-17T03:22:30.207Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="update" tid="NewClassification">
<status>SUCCESS</status>
<description>The classification has been saved successfully</description>
</response>
</responses>
</pim>
Error response examples
Classification not found when updating 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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="create">
<status>ERROR</status>
<description>There is no classification with the given identity '15342'</description>
</response>
</responses>
</pim>
Unable to create root node
<?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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="create">
<status>ERROR</status>
<description>Unable to create the root node, identifier should match the classification name, classification: NewClassification, root node: NewClassification1</description>
</response>
</responses>
</pim>
Language code 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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="create">
<status>WARNING</status>
<description>The classification has been saved successfully|Cannot find language id with code 'e_DE'.</description>
</response>
</responses>
</pim>
Classification localization already exists
<?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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">classification</itm>
</meta>
<responses>
<response dataType="classification" action="create">
<status>WARNING</status>
<description>The classification has been saved successfully|Unable to create new classification. Classification with name NewClassification-en already exist.</description>
</response>
</responses>
</pim>
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>'
<?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>
<?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>'
<?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>
<?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>