Retrieve attributes
| /pim/attributes/retrieve Retrieves attributes information. |
Allow to retrieve attributes by:
-
list of ids
-
list of product ids
-
list of product tids
-
list of node ids
-
list of node paths
|
| includeParentAttributes parameters default value is false for querying by nodeIds or nodePaths. Querying by productTids or productIds is always with inherited attributes and this parameter is ignored. |
Resource path |
/api/core/v1/pim/attributes/retrieve |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
|
Body parameters
Accepts AttributesRetrieveRequest
| Only one of input parameters ids, productIds, productTids, nodeIds or nodePaths should be specified in request. |
Return Type
PimType with filled AttributesType.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled AttributesType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
Samples
1.Retrieve attributes by ids parameter with Domain Values and Default Values
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"ids": [46190],
"withDomainValues": true,
"withDefaultValues": true
}'
{
"ids": [46190],
"withDomainValues": true,
"withDefaultValues": true
}
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr id="46190" inheritance="not_visible" key="new1" level="p" localized="false" restriction="optional">
<defaultVal tid="domain1"/>
<domainVals allowNewValue="false" mode="FULL" sortDirection="MANUAL">
<domainVal tid="domain1">
<itm loc="en_GB">domain1-en</itm>
<itm loc="de_DE">domain1-de</itm>
</domainVal>
</domainVals>
</attr>
</attrs>
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2023-02-20T08:13:06.210Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
</pim>
2.Retrieve attributes by productTids parameter with parent attributes, Domain Values and Default Values
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"productTids": ["ec98dde6-4064-465d-a1fb-237e2f10a336"],
"withDomainValues": true,
"withDefaultValues": true
}'
{
"productTids": ["ec98dde6-4064-465d-a1fb-237e2f10a336"],
"withDomainValues": true,
"withDefaultValues": true
}
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr id="44793" inheritance="not_visible" key="new2" level="p" localized="false" restriction="optional"/>
<attr id="46190" inheritance="not_visible" key="new1" level="p" localized="false" restriction="optional">
<defaultVal tid="domain1"/>
<domainVals allowNewValue="false" mode="FULL" sortDirection="MANUAL">
<domainVal tid="domain1">
<itm loc="en_GB">domain1-en</itm>
<itm loc="de_DE">domain1-dee</itm>
</domainVal>
</domainVals>
</attr>
</attrs>
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2023-02-20T08:22:32.516Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
</pim>
3.Retrieve attributes by productIds parameter with parent attributes and without Domain Values and Default Values
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"productIds": [44812]
}'
{
"productIds": [44812]
}
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr id="44793" inheritance="not_visible" key="new2" level="p" localized="false" restriction="optional"/>
<attr id="46190" inheritance="not_visible" key="new1" level="p" localized="false" restriction="optional">
</attr>
</attrs>
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2023-02-20T08:22:32.516Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
</pim>
4.Retrieve attributes by nodeIds parameter with parent attributes, without Domain Values and Default Values
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"nodeIds": [34812],
"includeParentAttributes": true
}'
{
"nodeIds": [34812],
"includeParentAttributes": true
}
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr id="44793" inheritance="not_visible" key="new2" level="p" localized="false" restriction="optional"/>
<attr id="46190" inheritance="not_visible" key="new1" level="p" localized="false" restriction="optional">
</attr>
</attrs>
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2023-02-20T08:22:32.516Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
</pim>
5.Retrieve attributes by nodePaths parameter without parent attributes, Domain Values and Default Values
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"nodePaths": ["RootNode/ChildNode"]
}'
{
"nodePaths": ["RootNode/ChildNode"]
}
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr id="46190" inheritance="not_visible" key="new1" level="p" localized="false" restriction="optional">
</attr>
</attrs>
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2023-02-20T08:22:32.516Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
</pim>