The widget request object

You can add a widget JSON object in a Sitecore Discover Search and Recommendation request. The object contains identifiers for specific locations to display merchandising and content widgets on a page. Widgets are key components in creating the personalization experiences that Discover provides.

The following shows the structure of the widget object in a request:

{
    "widget": {
	"rfkid": "<value>",
	"widget_id": "<value>",
	"all": "<value>"
    }
}

Keys

The following table describes the keys that theĀ widget object contains.

KeyType/default valueDescription
rfkidstringRequired if you do not send all widgets.A Sitecore Discover ID associated with the widget. You must send this parameter or select all widgets.NoteSpecify only one ID, either rfkid or widget_id. We recommend you use rfkid when you specify a widget.
widget_idstringA unique ID assigned to a widget by Sitecore Discover.NoteThe widget_id takes precedence if you specify both rfkid and widget_id.
allBooleanIf true, Discover returns all widgets on the page as a batch.NoteIf you set all to true, do not specify an rfkid or widget_id. If you do, you get an invalid request error.Default: false

Examples

The following are examples of using widgets using the different keys.

In the first example, the request uses a widget_id with a value of 3000.

{
    "widget": {
	"widget_id": "3000"
    }
}

The next request selects all widgets in a page defined in the Customer Engagement Console and returns the response in a batch.

{
    "widget": {
	"all": true
    }
}

In the last example, the request selects the rfkid with an ID of rfkid_3.

{
    "widget": {
	"rfkid": "rfkid_3"
    }
}
If you have suggestions for improving this article, let us know!