XM
Members
Retrieve Attributes by Item IDs
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
POST https://{baseurl}/api-configuration/attribute/get-by-item-ids
Copied!
Enables you to retrieve attribute details, by item IDs. The response includes the list of item IDs (specified in the request) along with their attributes. If no attribute is mapped to any of the requested item IDs, the status, code, and message are displayed to indicate the error reason.

Headers

Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type: Body
Name: The list of item IDs.
Required: true

Sample Request

Path:
1
POST https://{baseurl}/api-configuration/attribute/get-by-item-ids
Copied!
Request Body:
1
{
2
"itemIds": [
3
"1000000050",
4
"1000000033",
5
"1000011037"
6
]
7
}
Copied!

Response

Success Code: 200
Message: OK
Description: You'll see this message when the attribute details are retrieved for the requested item IDs.
In this sample, the first two items don't have attributes mapped so the "status" is shown as "Error." The code and the message indicates the error reason. Even if the item ID is invalid, the same error is shown.
1
[
2
{
3
"itemId": "1000000050",
4
"status": "Error",
5
"code": "ATTRIBUTE_NOT_FOUND_ERROR",
6
"message": "Attribute Not Found for itemId"
7
},
8
{
9
"itemId": "1000000033",
10
"status": "Error",
11
"code": "ATTRIBUTE_NOT_FOUND_ERROR",
12
"message": "Attribute Not Found for itemId"
13
},
14
{
15
"itemId": "1000011037",
16
"attributes": [
17
{
18
"_id": "6092cba26fe410000872bc62",
19
"price": "25",
20
"name": "Gift Wrap",
21
"type": "bool"
22
},
23
{
24
"_id": "60a77de306f682000975c24c",
25
"price": "10",
26
"name": "Gift Message",
27
"type": "string"
28
}
29
]
30
}
31
]
Copied!
Error Code: 500
Message: Internal Server Error
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

  • June - 2021 First updated
Last modified 1mo ago
Copy link
Contents
Change Log