Attributes API
Provides operations on OMN node attributes.
Query attributes
| /pim/attributes/query Gets list of attribute IDs. |
Allow to query attributes ids by:
-
Product tid
-
Product id
-
Node id
-
Node path
| includeParentAttributes parameter indicates whether to query inherited attributes. |
| includeParentAttributes parameters default value is false for querying by nodeId or nodePath. Querying by productTid or productId is always with inherited attributes and this parameter is ignored. |
Resource path |
/api/core/v1/pim/attributes/query |
HTTP method |
POST |
Request content type |
application/json; |
Response content type |
application/json; |
Body parameters
Accepts AttributesQueryRequest
Return Type
AttributesRequest with attributes ids.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
Found attributes ids. |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
Samples
1.Query attributes by product id
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"productId": [65874]
}'
{
"productId": [65874]
}
{
"ids": [75662, 34345, 43213]
}
2.Query attributes by product tid
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"productTid": [150185]
}'
{
"productTid": [150185]
}
{
"ids": [75662, 34345, 43213]
}
3.Query attributes by node id
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"nodeId": [96648]
}'
{
"nodeId": [96648]
}
{
"ids": [75662, 34345, 43213]
}
4.Query attributes by node path with inherited attributes
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"nodePath": [96648],
"includeParentAttributes": true
}'
{
"nodePath": [96648],
"includeParentAttributes": true
}
{
"ids": [75662, 34345, 43213, 96884, 55478]
}
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>
Persist attributes
| /pim/attributes/persist Saves node attributes information. |
Allow to
-
Create the attribute
-
Update attribute values (AttributeType.vals)
Resource path |
/api/core/v1/pim/attributes/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Body parameters
Accepts PimType with AttributesType
| When creating attribute nodePath or nodeId parameters must be specified. |
When updating attributes one of parameters combination below must be used:
-
attribute id
-
nodeId and attribute key
-
nodePath and attribute key
| Attribute parameter key is attribute definition value. |
Return Type
PimType with statuses ResponsesType about each persisted attribute.
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
1.Create attribute by node id
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attributes/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">
<attrs>
<attr nodeId="23456"
key="gender"
level="p"
inheritance="visible"
restriction="optional"
localized="true">
<domainVals allowNewValue="false" sortDirection="MANUAL">
<domainVal tid="female">
<itm loc="en_EN">female</itm>
<itm loc="de_DE">weiblich</itm>
</domainVal>
</domainVals>
</attr>
</attrs>
</pim>'
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr nodeId="23456"
key="gender"
level="p"
inheritance="visible"
restriction="optional"
localized="true">
<domainVals allowNewValue="false" sortDirection="MANUAL">
<domainVal tid="female">
<itm loc="en_EN">female</itm>
<itm loc="de_DE">weiblich</itm>
</domainVal>
</domainVals>
</attr>
</attrs>
</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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response dataType="attribute" action="create" id="95547" nodeId="23456">
<status>SUCCESS</status>
<description>The attribute has been created successfully</description>
</response>
</responses>
</pim>
2.Create attribute by node path
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attributes/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">
<attrs>
<attr nodePath="/RootNode/someNode"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</pim>'
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr nodePath="/RootNode/someNode"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response dataType="attribute" action="create" id="95547" nodePath="/RootNode/someNode">
<status>SUCCESS</status>
<description>The attribute has been created successfully</description>
</response>
</responses>
</pim>
3.Update attribute by attribute id
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attributes/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">
<attrs>
<attr id="95547"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</pim>'
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr id="95547"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response dataType="attribute" action="update" id="95547">
<status>SUCCESS</status>
<description>The attribute has been saved successfully</description>
</response>
</responses>
</pim>
4.Update attribute by nodePath and attribute key
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attributes/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">
<attrs>
<attr nodePath="/RootNode/someNode"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</pim>'
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr nodePath="/RootNode/someNode"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response dataType="attribute" action="update" nodePath="/RootNode/someNode" key="product_id">
<status>SUCCESS</status>
<description>The attribute has been saved successfully</description>
</response>
</responses>
</pim>
5.Update attribute by nodeId and attribute key
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attributes/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">
<attrs>
<attr nodeId="65425"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</pim>'
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<attrs>
<attr nodeId="65425"
inheritance="visible"
key="product_id"
level="p"
localized="false"
restriction="optional"/>
</attrs>
</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-09-27T12:41:38.795Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response dataType="attribute" action="update" nodeId="65425" key="product_id">
<status>SUCCESS</status>
<description>The attribute has been saved successfully</description>
</response>
</responses>
</pim>
Error responses
Attribute not found by attribute 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-27T08:49:34.889Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response action="update" dataType="attribute" key="product_id">
<status>ERROR</status>
<description>Attribute with id 23456 was not found.</description>
</response>
</responses>
</pim>
Node not found by node 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-27T08:52:40.287Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response action="create"
dataType="attribute"
key="product_id"
nodeId="23456">
<status>ERROR</status>
<description>Node with id 23456 not found</description>
</response>
</responses>
</pim>
Node not found by nodePath
<?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-27T08:53:36.908Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response action="create"
dataType="attribute"
key="product_id"
nodePath="RootNode/someNode">
<status>ERROR</status>
<description>Node with path RootNode/someNode not found</description>
</response>
</responses>
</pim>
Attribute definition 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-12-27T08:55:28.589Z</itm>
<itm key="sourceEnv">web</itm>
<itm key="itemInformationType">attribute</itm>
</meta>
<responses>
<response action="create"
dataType="attribute"
key="not_exists"
nodePath="RootNode/someNod">
<status>ERROR</status>
<description>Attribute definition: 'not_exists' cannot be found</description>
</response>
</responses>
</pim>
Perform attributes
| /pim/attributes/perform Deletes attributes. |
Allow to
-
Delete attribute definition by id
Resource path |
/api/core/v1/pim/attributes/perform |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Body parameters
Accepts PimType with ActionsType.
Return Type
PimType with statuses ResponsesType about each performed attribute.
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
1. Delete attribute by id
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attributes/perform' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data '<?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-06-04T10:10:16.774Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<actions>
<action dataType="attribute" id="98756" 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-06-04T10:10:16.774Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<actions>
<action dataType="attribute" id="98756" 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">2023-02-14T11:29:11.613Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="attribute" id="98756">
<description>Attribute definition has been deleted successfully</description>
<status>SUCCESS</status>
</response>
</responses>
</pim>
Error response examples
The attribute does not exist
<?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-14T11:37:25.990Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response action="delete" dataType="attribute" id="45260">
<description>Attribute not found with given id</description>
<status>ERROR</status>
</response>
</responses>
</pim>
The attribute id is missing in request
<?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-14T11:37:25.990Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="attribute" action="delete">
<status>ERROR</status>
<description>"Attribute 'id' is required to process attribute deletion"</description>
</response>
</responses>
</pim>