WishListItemsFindAll Endpoint

Overview

You might want to have a list of all wish list items that have been added by all customers in your store.  This endpoint allows you to get a listing of all wish list items for customers in your store.

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of REST and API’s
  • Understanding of C# and/or JavaScript
  • Visual Studio 2012 or newer

Getting Started

You should already have a project open and ready to accept code to allow you to use this REST API endpoint.  You should also have one or more wish list items created so that you can successfully find some.

WishListItemsFindAll

This REST API endpoint allows you to find all wish list items in your store. 

Example URL

This is what the REST endpoint will look like if you are calling it using JavaScript.  See our REST API URL documentation for more information.

http://example.com/DesktopModules/Hotcakes/API/rest/v1/wishlistitems/

HTTP Method

GET

Parameters

There are no parameters for this endpoint.

Returns

If successful, this endpoint will return a populated list of the WishListItemDTO object in JSON format.  Otherwise, you should have one or more errors returned.

Example Code

The following code will allow you to successfully call this endpoint, provided that you have enabled it.

Project References

  • Hotcakes.CommerceDTO

Import Namespaces

  • Hotcakes.CommerceDTO.v1
  • Hotcakes.CommerceDTO.v1.Catalog
  • Hotcakes.CommerceDTO.v1.Client

 

string url = "http://example.com";
string key = "YOUR-API-KEY";

Api proxy = new Api(url, key);

// call the API to find the wish list items
ApiResponse<List<WishListItemDTO>> response = proxy.WishListItemsFindAll();
// your domain name
var url = "http://example.com"; 
// the path where the API is
var apiPath = "/DesktopModules/Hotcakes/API/rest/v1/";  
// endpoint as shown in the documentation
var endPoint = "wishlistitems";  
// get this from the store admin
var apiKey = "YOUR-API-KEY";

$(document).ready(function() {

    // call the API to find the wish list items
    $.ajax({
        dataType: "json",
        url: url + apiPath + endPoint + "?key=" + apiKey,
        type: 'GET',
        success: function (data) {
            // do something
        },
        error: function (jqXHR, textStatus) {
           // do something else
        }
    });

});
{
   "Errors":[

   ],
   "Content":[
      {
         "Id":1,
         "StoreId":1,
         "CustomerId":"2",
         "LastUpdatedUtc":"\/Date(1403257583907)\/",
         "ProductId":"dfcae0ee-8bcf-4321-8b31-7883b5434285",
         "Quantity":1,
         "SelectionData":[

         ]
      },
      {
         "Id":2,
         "StoreId":1,
         "CustomerId":"3",
         "LastUpdatedUtc":"\/Date(1403257711740)\/",
         "ProductId":"dfcae0ee-8bcf-4321-8b31-7883b5434285",
         "Quantity":1,
         "SelectionData":[

         ]
      },
      {
         "Id":3,
         "StoreId":1,
         "CustomerId":"3",
         "LastUpdatedUtc":"\/Date(1403259862553)\/",
         "ProductId":"5d520070-17e5-4587-bddb-9935bc584b6c",
         "Quantity":2,
         "SelectionData":[
            {
               "OptionBvin":"f5c6fbd865c6494291737f1c2c64b8c1",
               "SelectionData":"90c9ce3cad0e4b8daba93e825db2de93"
            }
         ]
      },
      {
         "Id":4,
         "StoreId":1,
         "CustomerId":"3",
         "LastUpdatedUtc":"\/Date(1403262038847)\/",
         "ProductId":"dfcae0ee-8bcf-4321-8b31-7883b5434285",
         "Quantity":1,
         "SelectionData":[

         ]
      },
      {
         "Id":6,
         "StoreId":1,
         "CustomerId":"3",
         "LastUpdatedUtc":"\/Date(1403318445917)\/",
         "ProductId":"dfcae0ee-8bcf-4321-8b31-7883b5434285",
         "Quantity":2,
         "SelectionData":[

         ]
      },
      {
         "Id":8,
         "StoreId":1,
         "CustomerId":"1",
         "LastUpdatedUtc":"\/Date(1411438705247)\/",
         "ProductId":"964163db-e733-4cbd-ace5-32717d813f3e",
         "Quantity":1,
         "SelectionData":[

         ]
      },
      {
         "Id":9,
         "StoreId":1,
         "CustomerId":"5",
         "LastUpdatedUtc":"\/Date(1411438811207)\/",
         "ProductId":"dfcae0ee-8bcf-4321-8b31-7883b5434285",
         "Quantity":1,
         "SelectionData":[

         ]
      },
      {
         "Id":10,
         "StoreId":1,
         "CustomerId":"5",
         "LastUpdatedUtc":"\/Date(1411438832100)\/",
         "ProductId":"b1ee12d3-950c-4bde-af8f-65eac37582f1",
         "Quantity":12,
         "SelectionData":[

         ]
      },
      {
         "Id":11,
         "StoreId":1,
         "CustomerId":"4",
         "LastUpdatedUtc":"\/Date(1411438866183)\/",
         "ProductId":"d75b3319-e87c-43d3-8c0b-c4503ad52083",
         "Quantity":1,
         "SelectionData":[
            {
               "OptionBvin":"f6a36a59a9664c5eb6f942c5d6834ed9",
               "SelectionData":"e667fb466183422fb23cf9f23b9c2327"
            },
            {
               "OptionBvin":"767f7a4b61c649e49e2d0db5994cbf57",
               "SelectionData":"75a535b195af454786c64ab43650e602"
            }
         ]
      }
   ]
}
Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.