Skip to main content
RichRelevance

Streaming View

Introduction

The streaming-view service provides a means to view items  (products, categories and regions) which have successfully been processed and are stored in the Streaming View Store.

The streaming-view service enables users to view items which have reached engine.out and stored in the Streaming View Store.   
Allows users to view categories, regions, or products for a specific snapshot.  Users can view either an individual item by using the external ID or all items for a specific item type in the specified snapshot.

Streaming view has many response styles that can be paged through by ID, a rolling count, or by viewing the full record (“processed”).  If no responseStyle is provided, the default view is returned. 

For large catalogs, it is recommended to page the results that are returned by using the “page” and “rows” parameter along with a responseStyle. You need to use a responseStyle to view the pagination JSON.  For backward compatibility, the current view with the nextCursorMark is supported now for pagination but it is recommended to use the responseStyle and “page” parameter.   The “page parameter is also used with the status service and invalid item store.  

Note: cursorMark will be deprecated later in 2020.  It is recommended to use a responseStyle with “rows” and “page”. 

Streaming View Service Response Styles and Pagination

There are three responseStyles: count, id, and processed.  For each, a default number of items will automatically be returned. You can use the “rows” parameter to over-ride the default.

The following are descriptions for each parameter.

responseStyle

Description

Default returned without “rows” parameter defined

Max returned per page

processed

All attributes for an item.  Current default view.

1,000

10,000

       

id

List of IDs for each item

5,000

50,.000

count

Rolling count - as you page through, the rolling count will increase

5,000 

50,000

count

Rolling count - as you page through, the rolling count will increase

5,000 

50,000

If the number of items in the view store is in thousands, it is recommended to page through the list of items, otherwise the streaming view service may timeout.  There are two pagination parameters "rows" and “page”.  These parameters work only with the responseStyles listed above. 

Pagination is optional and is invoked only when the "rows" parameter is included in the call. If the "rows" parameter is not included, the first 1,000 items are returned. 

If the “rows” parameter is included with any of the responseStyles, then the list of status messages are paginated, and a pagination JSON is included at the beginning of the response. The pagination response will include the number of items returned, a rolling count,  and the nextPage token.  If the rows parameters are not included, the default rows will be returned which is listed above for each responseStyle.

Additional examples are available at the end of section, “parameters and endpoints”.

Example: responseStyle=count

Below is an example for the “count” response style, where the rolling total is provided. Note that the maximum number of items to be returned is 50,000 per page. 

GET https://<host>/streaming-view/v1/apikey/<snapshotId>/<itemType>?responseStyle=count&rows=50000

Example: 
apiKey: 123
Snapshot: 700
itemType: product

GET https://<host>/streaming-view/v1/123/700/product?responseStyle=count&rows=50000
Response:
{
    "pagination": {
        "rows": 50000,
        "nextPage": "50000:8lk9v2quqbajk",
        "runningTotal": 50000
    }
}

Example to get the next set of results.    
Note: If nextPage is an empty string and does not appear, then you are at the end of the results.

GET  https://<host>/streaming-view/v1/123/700/product?rows=50000&page=50000:8lk9v2quqbajk
{
    "pagination": {
        "rows": 50000,
        "nextPage": "100000:9b3oon3rfvncp",
        "runningTotal": 100000
    }
}

Example to get the next set of results, which is the end of the items.

Note: If nextPage is an empty string and does not appear, then you are at the end of the results.

GET  https://<host>/streaming-view/v1/123/700/product?responseStyle=count&rows=50000
&page=50000:8lk9v2quqbajk
{
    "pagination": {
        "rows": 30000,
         "runningTotal": 130000
    }
}

Note: Below is pagination for the current default view.  This will be deprecated in late 2020. 

Below is the URL syntax for paging through results.  By default, the first 1000 items are returned.  The max value for rows is 10,000.

https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/<itemType>?rows=<numberOfRowsPerPage>[&nextCursorMark=<nextCursorMarkFromEarlierResponse>]
'Authorization:Bearer <tokenValue>’

Streaming View Parameters and Endpoints

BaseURL:  https://<host>/streaming-view/v1/
'Authorization:Bearer <tokenValue>’

FullURL:  https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/<itemType>/<externalId>
'Authorization:Bearer <tokenValue>’
 

Description Syntax

Get all region items for a specific snapshot.

Note: The first 1000 items are returned.  Use pagination, if there are more than 1000 items.

GET {baseURL}/<apiKey>/<snapshotId>/region

Get all category items for a specific snapshot.

Note: The first 1000 items are returned.  Use pagination, if there are more than 1000 items.

GET {baseURL}/<apiKey>/<snapshotId>/category

Get the hierarchy of the category items for a specific snapshot.

GET {baseURL}/<apiKey>/<snapshotId>/category/hierarchy

Get a specific product, region, or category item.

GET {baseURL}/<apiKey>/<snapshotId>/<itemType>/<externalId>

Pagination: 

Currently works with responseStyleTypes:  id, count, and processed.
If “rows” parameter is not included, the default number of items is returned. Defaults are defined in the above table. 

https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/<itemType>?responseStyle=
<responseStyeType>&rows=<itemsPerPage>

Next Page:

Page through the view store. nextPage value is provided in the response.  The pagination JSON includes a rolling count

https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/<itemType>?responseStyle=
<responseStyeType>&rows=<itemsPerPage>& page=<nextPage>
Note: The following is for the current default view of items.   “nextCursorMark” will be deprecated in late 2020 and replaced with nextPage.
https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/product?[rows=
<numberOfRowsPerPage>]

Response will include:
numFound - total number of results
nextCursorMark - to be used to retrieve the next page of results 

Get the first 1000 products or optionally set the number of rows to be returned using the “rows” parameter. If numFound is greater than the rows returned, please use pagination to get the next page of results. Example:
 "numFound": 101,
"nextCursorMark": "AoEtcDo3NjkwNTE0MDM4Mw=="
Get the next 1000 products or the number of rows that have been set.
https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/product?rows=
<numberOfRowsPerPage>&nextCursorMark=<nextCursorMarkFromEarlierReponse>

Parameters

Name

Description

Required or Optional

Values and Additional Information

<itemType>

Supported item types are product, category, and region. Reference content is not yet supported by the streaming catalog services.

Required

product, category, or region

<apiKey>

Unique identifier for a customer’s environment.

For example, if a customer has multiple environments in production or staging, each will have a unique apiKey.   There can be many apiKeys associated to a client_ID

Required

Provided by RR to customer

<snapshotId>

Specifies the uUnique identifier for the snapshot

Required

snapshotId is provided in the response when creating the snapshot.

<externalId>

Specifies the unique item identifier.

Optional

 

hierarchy

Category specific parameter to display the category items' hierarchy.

Optional

Example:

GET {baseURL}/<apiKey>/<snapshotId>/category/hierarchy

rows

Specifies the number of rows to be returned. 

Optional

integer.  Default is 1,000.  Max is 10,000. 

Example:  rows=100

page

To see the next page, the page parameter needs to be included with the <nextpage> value that is returned in the pagination JSON.

 

 

 

recommendable

To count the recommendable products .

The “propVal” property should be set to “true” to count the recommendable products.

Note: If you do not include the “propVal” property, then all products that have the <propName>  property will be counted.

Optional
https://<host>/streaming-view/v1/<apiKey>/<snapshotId>/product?rows=50000&
responseStyle=count&propName=recommendable&propVal=true

 

Example

Examples are provided below.

Example 1:  Category Hierarchy

where apiKey: 123, snapshotId: 999

GET https:/gateway.richrelevance.com/streaming-view/v1/123/999/category/hierarchy

Response:

200 OK
{
    "hierarchy": {
        "sampleCategory1": [
            "sampleCategory2"
        ]
    },
    "root": [
        "sampleCategory1"
    ]
}
  • Was this article helpful?