Fetch List Details
Fetch the list details along with the list contents.
swat.fetchListDetails
Returns the information of the List with the given lid
. The details include the list
and the list items
.
Things to consider
This API is used most commonly to fetch list information along with list items for a given
lid
.
Definition
swat.fetchListDetails(listConfig, onSuccess, onError)
Example
Here's an example of how you can use this API to fetch details of a List called black Friday list
:
// define the list config
let listConfig = {
"lid": "59179e9f-139d-4857-bcdd-3ad88a38b47d", // lid
};
// Define success callback
let onSuccess = function(listDetails) {
// Successfully fetched list details
console.log("Successfully fetched List details", listDetails);
}
// Define error callback
let onError = function(error) {
// Error is an xhrObject
console.log("Error while fetching List details", error);
}
// Call `fetchListDetails` with the above callbacks and listConfig
swat.fetchListDetails(listConfig, onSuccess, onError);
API Parameters
Argument | Type | Description |
---|---|---|
listConfig | object | Object containing the Unique id of the List to fetch its details. |
onSuccess | function | Called when the List details are successfully fetched. |
onError | function | Called when there is an error while fetching the List details |
Success Responses
The success response contains details of the List along with the array of its List Contents. This information can be used to retrieve or manipulate the List Contents or Products in future API calls.
{
"list": {
"di": "fb283019-487b-4447-99e6-133178f6477e",
"listcontents": [
{
"di": "fb283019-487b-4447-99e6-133178f6477e",
"bt": "Swym Marketing",
"dt": "12 Inches Round Rose Gold Frame Wall Mirror",
"cts": 1679598072363,
"empi": 7096437407942,
"sku": "45",
"cby": null,
"lid": "313bef26-16b4-4861-be1b-c986f6ac5871",
"du": "https://demo.swym.it/products/12-inches-round-rose-gold-frame-wall-mirror?variant=41255230701766",
"pid": "/IV7e7cGxT1978LieU1jRdMt6XhYfo=",
"epi": 41255230701766,
"id": "5d054a90-a2b2-4f9d-854a-90a2b2ef9d68",
"uts": 1679598072363,
"_pkey": "fb283019",
"iu": "https://cdn.shopify.com/s/files/1/0534/3635/0662/products/12InchesRoundRoseGoldFrameWallMirror_620x620.jpg?v=1637593774",
"_t": 2,
"uby": null,
"pr": 200.0
}
],
"userinfo": null,
"lty": "wl",
"cts": 1679598072091,
"cnt": 1,
"lname": "My Wishlist",
"cby": null,
"lid": "313bef26-16b4-4861-be1b-c986f6ac5871",
"pid": "/IV7e7cGxT1978LieU1jRdMt6XhYfo=",
"st": 1,
"id": "b0977fa0-f3b1-4023-977f-a0f3b1502348",
"canEdit": false,
"uts": 1679598072091,
"_pkey": "fb283019",
"_t": 1,
"itemcmnts": 0,
"uby": null,
"lhash": "bXktd2lzaGxpc3Q="
},
"items": [
{
"di": "fb283019-487b-4447-99e6-133178f6477e",
"bt": "Swym Marketing",
"dt": "12 Inches Round Rose Gold Frame Wall Mirror",
"cts": 1679598072363,
"empi": 7096437407942,
"sku": "45",
"cby": null,
"lid": "313bef26-16b4-4861-be1b-c986f6ac5871",
"du": "https://demo.swym.it/products/12-inches-round-rose-gold-frame-wall-mirror?variant=41255230701766",
"pid": "/IV7e7cGxT1978LieU1jRdMt6XhYfo=",
"epi": 41255230701766,
"id": "5d054a90-a2b2-4f9d-854a-90a2b2ef9d68",
"uts": 1679598072363,
"_pkey": "fb283019",
"iu": "https://cdn.shopify.com/s/files/1/0534/3635/0662/products/12InchesRoundRoseGoldFrameWallMirror_620x620.jpg?v=1637593774",
"_t": 2,
"uby": null,
"pr": 200.0
}
]
}
Updated over 1 year ago