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.
|
Key |
Type/default value |
Description |
|---|---|---|
|
|
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 |
|
|
string |
A unique ID assigned to a widget by Sitecore Discover. Note The |
|
|
Boolean |
If Note If you set Default: |
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"
}
}