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 1. 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 2. 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>

Welcome to the AI Chat!

Write a prompt to get started...