Loading...
Area: Episerver Perform, Episerver Reach
Applies to versions: 1.0 and higher (JavaScript API)

JSONArray callback examples

The following example shows the JSONArray callback for a widget with full product details, default behavior and when recContent is omitted or has the value full:

[{
  "widget"   : "homejson",
  "alias"    : "homewidget",
  "position" : "homebottom", 
  "recs"     : [{
		  "img"      : "http://m.retailer.com/showimg.php?id=2086&size=tiny", 
		  "title"    : "Mighty Water Bottle: Blue", 
		  "url"      : "http://m.retailer.com/product/mighty-water-bottle-blue", 
		  "refCode"  : "mighty-water-bottle-blue", 
		  "location" : "en-gb", 
		  "prices"   : {
			         "GBP" : {
				           "unitPrice" : 4.95, 
				           "salePrice" : 3.95
			                 }
		               }, 
		  "id"       : 32720906612,
	         }, 
                 {
  	           ...more products
                }]
}]

The following example shows the JSONArray callback for a widget with the recContent property set to refCodeOnly:

[
  "widget"   : "homejson",
  "alias"    : "homewidget",
  "position" : "homebottom", 
  "recs"     : [ 
		 {"id" : 17994255560, "refCode" : "DVD-SPEED2"},
		 {"id" : 17994255576, "refCode" : "DVD-TSAB"}
	       ]
]
Do you find this information helpful? Please log in to provide feedback.

Last updated: Nov 06, 2017