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