Fetch Wishlist Social Count

Fetch the wishlist social-count of a product

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 product = {  
  empi: 7096252727494 // id of the product  
};

// Define success callback  
let onSuccess = function(data) {  
  // Executed when a social count data is successfully fetched  
  console.log("Successfully fetched social count data of the product: ", data);  
}

// Define error callback  
let onError = function(error) {  
  console.log("Error while fetching social count", error);  
}

// Fetch the social count of the product  
swat.wishlist.getSocialCount(product, onSuccess, onError);

API Parameters

ArgumentTypeDescription
productobjectData about the product should include empi.
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": 9,
        "empi": 7096252727494
    }
}

🚧

Product Validations and API Response Behavior

If the submitted product 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
product.empiint/stringProduct id of the product to be added