---
title: "The widget request object"
slug: "the-widget-request-object"
abstract: "Describes the structure and properties of the widget object in a Discover Search and Recommendation request."
---
# 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:

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

<details>
<summary><h2>Keys</h2></summary>

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.NoteSpecify 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.NoteThe 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.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 |

</details>

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

```csharp
{
    "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.

```csharp
{
    "widget": {
	"all": true
    }
}
```

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

```csharp
{
    "widget": {
	"rfkid": "rfkid_3"
    }
}
```