Catalogs

    List the catalogs of a site

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/catalogs
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    An array of the first 10 catalogs; each object has the following properties:

    • id - catalog's id (numeric)
    • siteId - site's id (numeric)
    • parentId - the ID of this catalog's parent (-1 if this is a root level catalog) (numeric)
    • templateId - templateId (numeric)
    • roleId - the roleID of the user to be notified if the catalog is about to expire (-1 for none) (number)
    • displayTypeId - show prices to everybody or only to existing customers. Possible values are:
      • 1: everyone
      • 2: only existing customers
    • weight - catalog's weight (numeric)
    • name - catalog's name (string)
    • title - catalog's title (string)
    • description - catalog's description (string)
    • imageUrl - the path to the catalog's thumbnail (string)
    • releaseDate - catalog's release date (dateTime)
    • expiryDate - catalog's expiry date (dateTime)
    • notify - user to notify (numeric)
    • createDate - catalog's creation date (dateTime)
    • lastUpdateDate - catalog's last update date (dateTime)
    • useFriendlyUrl - catalog URL (string)
    • excludeFromFeed - whether the products in this catalog are included in the XML feed (boolean)
    • enabled - whether the catalog is enabled or not (boolean)
    • deleted - whether the catalog is deleted or not (boolean)
    • minPrice - browsepanel minimum price (numeric)
    • maxPrice - browsepanel maximum price (numeric)
    • priceSlots - the total number of slots in the browsepanel (numeric)
    • productsStatsXml - productsStatsXml (string)
    • url - catalog's url (string)

    You can output additional fields to those listed above as default, see the API v3 Discovery APP for additional details.

    Accepts and returns JSON as Content-Type.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/catalogs",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Sample response

    {
      "items": [
        {
          "id": 25479,
          "siteId": 246884,
          "parentId": -1,
          "templateId": 597258,
          "roleId": -1,
          "displayTypeId": 2,
          "weight": null,
          "name": "Classic Boutique",
          "title": "",
          "description": "",
          "imageUrl": "",
          "releaseDate": "2011-04-11T00:00:00",
          "expiryDate": "9998-12-31T15:00:00",
          "notify": null,
          "createDate": "2015-08-18T12:41:39.233",
          "lastUpdateDate": "2015-08-18T12:41:39.233",
          "useFriendlyUrl": true,
          "excludeFromFeed": false,
          "enabled": true,
          "deleted": false,
          "minPrice": 0,
          "maxPrice": 1000,
          "priceSlots": 5,
          "productsStatsXml": "3003000000300000030000003",
          "url": "/classic-boutique"
        },
        {
          "id": 25481,
          "siteId": 246884,
          "parentId": -1,
          "templateId": 597258,
          "roleId": -1,
          "displayTypeId": 1,
          "weight": null,
          "name": "Woody Perfumes",
          "title": "",
          "description": "",
          "imageUrl": "",
          "releaseDate": "2011-04-11T00:00:00",
          "expiryDate": "9998-12-31T15:00:00",
          "notify": null, 
          "createDate": "2015-08-18T12:41:39.233",
          "lastUpdateDate": "2015-08-18T12:41:39.233",
          "useFriendlyUrl": true,
          "excludeFromFeed": false,
          "enabled": true,
          "deleted": false,
          "minPrice": 0,
          "maxPrice": 1000,
          "priceSlots": 5,
          "productsStatsXml": "3003000000300000030000003",
          "url": "/woody-perfumes"
        }
      ],
      "totalItemsCount": 2,
      "skip": 0,
      "limit": 10
    }

    Get a catalog's attributes

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/catalogs/[catalog_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    Displays the details for the catalog as a JSON object

    • id - catalog's id (numeric)
    • siteId - site's id (numeric)
    • parentId - the ID of this catalog's parent (-1 if this is a root level catalog) (numeric)
    • templateId - templateId (numeric)
    • roleId - the roleID of the user to be notified if the catalog is about to expire (-1 for none) (number)
    • displayTypeId - show prices to everybody or only to existing customers. Possible values are:
      • 1: everyone
      • 2: only existing customers
    • weight - catalog's weight (numeric)
    • name - catalog's name (string)
    • title - catalog's title (string)
    • description - catalog's description (string)
    • imageUrl - the path to the catalog's thumbnail (string)
    • releaseDate - catalog's release date (dateTime)
    • expiryDate - catalog's expiry date (dateTime)
    • notify - user to notify (numeric)
    • createDate - catalog's creation date (dateTime)
    • lastUpdateDate - catalog's last update date (dateTime)
    • useFriendlyUrl - catalog URL (string)
    • excludeFromFeed - whether the products in this catalog are included in the XML feed (boolean)
    • enabled - whether the catalog is enabled or not (boolean)
    • deleted - whether the catalog is deleted or not (boolean)
    • minPrice - browsepanel minimum price (numeric)
    • maxPrice - browsepanel maximum price (numeric)
    • priceSlots - the total number of slots in the browsepanel (numeric)
    • productsStatsXml - productsStatsXml (string)
    • url - catalog's url (string)

    Accepts and returns JSON as Content-Type.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/catalogs/25479",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Sample response

    {
      "id": 25479,
      "siteId": 246884,
      "parentId": -1,
      "templateId": 597258,
      "roleId": -1,
      "displayTypeId": 2,
      "weight": null,
      "name": "Classic Boutique",
      "title": "",
      "description": "",
      "imageUrl": "",
      "releaseDate": "2011-04-11T00:00:00",
      "expiryDate": "9998-12-31T15:00:00",
      "notify": null,
      "createDate": "2015-08-18T12:41:39.233",
      "lastUpdateDate": "2015-08-18T12:41:39.233",
      "useFriendlyUrl": true,
      "excludeFromFeed": false,
      "enabled": true,
      "deleted": false,
      "minPrice": 0,
      "maxPrice": 1000,
      "priceSlots": 5,
      "productsStatsXml": "3003000000300000030000003",
      "url": "/classic-boutique"
    }