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:

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

Keys

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

Key

Type/default value

Description

rfkid

string

Required if you do not send all widgets.

A Sitecore Discover ID associated with the widget.  

You must send this parameter or select all widgets.

Note

Specify only one ID, either rfkid or widget_id. We recommend you use rfkid when you specify a widget.

widget_id

string

A unique ID assigned to a widget by Sitecore Discover.

Note

The widget_id takes precedence if you specify both rfkid and widget_id.

all

Boolean

If true, Discover returns all widgets on the page as a batch.

Note

If 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.

RequestResponse
{
    "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.

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

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

RequestResponse
{
    "widget": {
	"rfkid": "rfkid_3"
    }
}

Do you have some feedback for us?

If you have suggestions for improving this article,