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>