API Reference

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

ArgumentTypeDescription
empisarrayArray of empi. Max batch size is 10
onSuccessfunctionCalled when data is successfully fetched.
onErrorfunctionCalled 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 Behavior

If 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 NameData TypeDescription
empiint/stringProduct id of the product