The content response object
You get a content JSON object in the Sitecore Discover Search and Recommendation response if you send a content object in the request. The response returns each <content_type> added in your request as a separate key with a value object and displays the corresponding values according to the parameters in your request.
The following shows the basic structure of the content object in a response:
Keys
Keys
Depending on your request you may see some or all keys.
The following table describes the keys in the content response object:
|
Key |
Type |
Description |
|---|---|---|
|
|
Specific type of content you requested. | |
|
|
array |
If you set the Note Not all content has a value for every content field. By default, Discover returns a default set of content fields in the result. To set up custom content fields, contact your Sitecore customer representative. |
Content type object
Content type object
The following table describes the keys in the content type object:
|
Key |
Type |
Description |
|---|---|---|
|
|
object |
Value of |
|
|
integer |
Total number of items that match the query for the |
|
|
integer |
Number of items returned in the response for each |
Content types
Content types
The following table lists the currently supported content type. Each content type requires a feed or another data source. Additional content types can be supported on a per customer basis.
|
<content_type> |
Description |
|---|---|
|
|
Product catalog |
Related keys
The following table describes the keys related to the content response:
|
Key |
Type |
Description |
|---|---|---|
|
|
integer |
Server timestamp in milliseconds. |
|
|
string |
Unique, non-human-readable, generated ID of the response. |
|
|
integer |
Response processing time in milliseconds. |
|
|
string |
HTML-encoded URL representation of your request. You use the value to query the same request in the URL content type. |
|
|
integer |
Total number of items expected per page returned in the response. Discover calculates this from the sum of all |
|
|
integer |
Total number of content items that match the request. Discover calculates this from the sum of all |
|
|
integer |
Page number of the response. |
|
|
integer |
Total number of pages available for the request. |
|
|
string |
Unique, non-human-readable, identifier of the |
|
|
string |
The response returns this only if you sent a |
Example
The following code shows a sample content response: