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]
}

Welcome to the AI Chat!

Write a prompt to get started...