Attributes API

Provides operations on OMN node attributes.

Query attributes

/pim/attributes/query Gets list of attribute IDs.

Allow to query attributes ids by:

  1. Product tid

  2. Product id

  3. Node id

  4. 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.
Table 1. Details

Resource path

/api/core/v1/pim/attributes/query

HTTP method

POST

Request content type

application/json;

Response content type

application/json;

Body parameters
Return Type

AttributesRequest with attributes ids.

Responses
Table 2. Http response codes
Code Message Datatype

200

Found attributes ids.

AttributesRequest

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

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]
}'
Request body
{
     "productId": [65874]
}
Response body
{
    "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]
}'
Request body
{
     "productTid": [150185]
}
Response body
{
    "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]
}'
Request body
{
     "nodeId": [96648]
}
Response body
{
    "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
}'
Request body
{
     "nodePath": [96648],
     "includeParentAttributes": true
}
Response body
{
    "ids": [75662, 34345, 43213, 96884, 55478]
}

Retrieve attributes

/pim/attributes/retrieve Retrieves attributes information.

Allow to retrieve attributes by:

  1. list of ids

  2. list of product ids

  3. list of product tids

  4. list of node ids

  5. list of node paths

  • withDomainValues parameter indicates whether to query attributes with domain values. By default, withDomainValues parameter is false.

  • withDefaultValues parameter indicates whether to query attributes with default values. By default, withDomainValues parameter is false.

  • includeParentAttributes parameter indicates whether to query inherited attributes.

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.
Table 3. Details

Resource path

/api/core/v1/pim/attributes/retrieve

HTTP method

POST

Request content type

application/json

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters
Only one of input parameters ids, productIds, productTids, nodeIds or nodePaths should be specified in request.
Return Type

PimType with filled AttributesType.

Responses
Table 4. Http response codes
Code Message Datatype

200

PimType with filled AttributesType

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

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
}'
Request body
{
     "ids": [46190],
     "withDomainValues": true,
     "withDefaultValues": true
}
Response body
<?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
}'
Request body
{
     "productTids": ["ec98dde6-4064-465d-a1fb-237e2f10a336"],
     "withDomainValues": true,
     "withDefaultValues": true
}
Response body
<?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]
}'
Request body
{
     "productIds": [44812]
}
Response body
<?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
}'
Request body
{
     "nodeIds": [34812],
     "includeParentAttributes": true
}
Response body
<?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"]
}'
Request body
{
     "nodePaths": ["RootNode/ChildNode"]
}
Response body
<?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

  1. Create the attribute

  2. Update attribute values (AttributeType.vals)

Table 5. Details

Resource path

/api/core/v1/pim/attributes/persist

HTTP method

POST

Request content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

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
Table 6. Http response codes
Code Message Datatype

200

PimType with filled ResponsesType

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

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>'
Request body
<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>
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">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>'
Request body
<?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>
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">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>'
Request body
<?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>
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">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>'
Request body
<?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>
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">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>'
Request body
<?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>
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">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

  1. Delete attribute definition by id

Table 7. Details

Resource path

/api/core/v1/pim/attributes/perform

HTTP method

POST

Request content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters

Accepts PimType with ActionsType.

Return Type

PimType with statuses ResponsesType about each performed attribute.

Responses
Table 8. Http response codes
Code Message Datatype

200

PimType with filled ResponsesType

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

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>'
Request 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">2022-06-04T10:10:16.774Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <actions>
        <action dataType="attribute" id="98756" type="delete"/>
    </actions>
 </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-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>

Welcome to the AI Chat!

Write a prompt to get started...