Fetch Wishlist social count batch
Fetch batch of wishlist social-count of products
swat.wishlist.getSocialCount
Fetches the wishlist social-count of a product
Definition
swat.wishlist.getSocialCount(product, onSuccess, onError)
Example
Here is an example demonstrating how to use this API to get social-count of a product:
// Define the product object
let empis = [1234, 2314];
// Define success callback
let onSuccess = function(data) {
// Executed when a social count data is successfully fetched
console.log("Successfully fetched social count batch: ", data);
}
// Define error callback
let onError = function(error) {
console.log("Error while fetching social count batch", error);
}
// Fetch the social count of the product
swat.wishlist.getSocialCountBatch(empis, onSuccess, onError);
API Parameters
Argument | Type | Description |
---|---|---|
empis | array | Array of empi . Max batch size is 10 |
onSuccess | function | Called when data is successfully fetched. |
onError | function | Called when there is an error while fetching the data. |
Success Response
The success responses contain the social count and the product id that was passed as part of the request.
{
"data": [
{
"count": 10,
"empi": 1234
},
{
"count": 8,
"empi": 2314
}
]
}
Product Validations and API Response BehaviorIf the submitted product id data does not match an existing product, the API will respond with a 200 status code and a count of 0. If required, please perform necessary product validations on your end before making API requests.
References
Product
Property Name | Data Type | Description |
---|---|---|
empi | int/string | Product id of the product |
Updated 8 days ago