# Wishlist

The WISHLIST engagement allows users to send an email to all customers awaiting certain event (e.g. the customer receives a notification that the shoe size he is waiting for is now available). In order to use it, the eCommerce platform needs to send two additional events.

# topic_observe

Url: https://api.edrone.me/topic_observe

Sent when the customer observes an event (e.g. shoe size availability)

Field Description
app_id See Trace API below
email See Trace API below
topic_id Topic identifier is used to match topic_observe event with topic_publish event.
topic_campaign_id Campaign identifier of the observed topic. It is mapped to the email design. The default setup is the same design for all wishlist topics. If you would like to create more designs please contact our support.
<script>
    $('#__subscribe-button').on('click', function() {
       
        var email = $('#email').val(); // get this value from email input
        var productId = $('#product-box').data('product-id'); // example - productId can be provided in some other way 
        $.post('https://api.edrone.me/topic_observe', {
            app_id: '[YOUR_APP_ID]',
            email: email,
            topic_id: productId, //unique per topic
            topic_campaign_id: 0 // 0 - default email design
        }).done(function(data) {
           // handle this part based on your needs 
        });
    });
</script>

Example https://api.edrone.me/topic_observe?app_id=bdag3h3563u&email=przykladowyemail@gmail.com&topic_id=dg623be63bbs&topic_campaign_id=0&action_type=topic_observe

# topic_publish

Trigger notification for all the customers observing the topic. Url: https://api.edrone.me/topic_publish

Value Description
app_id See Trace API below
topic_id Topic identifier is used to match topic_observe event with topic_publish event.
product_ids See Trace API below
product_urls CSee Trace API below
product_skus See Trace API below
product_titles See Trace API below
product_images See Trace API below
product_category_ids See Trace API below
product_category_names See Trace API below
product_brand_ids See Trace API below
product_brand_names See Trace API below
<script>
    $('#notify-availability').on('click', function() {

        var productId = $('#product-id-input').val(); // example - productId can be provided in some other way
        $.post('https://api.edrone.me/topic_publish', {
            app_id: '[YOUR_APP_ID]',
            topic_id: productId,
            product_ids: 'example value',
            product_urls: 'example value',
            product_skus: 'example value',
            product_titles: 'example value',
            product_images: 'example value',
            product_category_ids: 'example value',
            product_category_names: 'example value',
            product_brand_ids: 'example value',
            product_brand_names: 'example value'
        }).done(function(data) {
            // handle this part based on your needs
            alert('Customers will be notified')
        });
    });
</script>

# get_subscribers_count

Returns the number of currently subscribed customers for a specific productId.
Url https://api.edrone.me/wishlist_get_subscribers_count?app_id=XX&product_id=XX

Field Description
app_id See Trace API below
product_id Id of product we ask for