class RecombeeApiClient::RecommendNextItems

Returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (*infinite scroll*) or goes to a next page.

It accepts `recommId` of a base recommendation request (e.g. request from the first page) and number of items that shall be returned (`count`). The base request can be one of:

- [Recommend items to item](https://docs.recombee.com/api.html#recommend-items-to-item)
- [Recommend items to user](https://docs.recombee.com/api.html#recommend-items-to-user)
- [Search items](https://docs.recombee.com/api.html#search-items)

All the other parameters are inherited from the base request.

*Recommend next items* can be called many times for a single `recommId` and each call returns different (previously not recommended) items. The number of *Recommend next items* calls performed so far is returned in the `numberNextRecommsCalls` field.

*Recommend next items* can be requested up to 30 minutes after the base request or a previous *Recommend next items* call.

For billing purposes, each call to *Recommend next items* is counted as a separate recommendation request.

Attributes

count[R]
ensure_https[RW]
recomm_id[R]
timeout[RW]

Public Class Methods

new(recomm_id, count) click to toggle source
  • *Required arguments*

    • recomm_id -> ID of the base recommendation request for which next recommendations should be returned

    • count -> Number of items to be recommended

# File lib/recombee_api_client/api/recommend_next_items.rb, line 38
def initialize(recomm_id, count)
  @recomm_id = recomm_id
  @count = count
  @timeout = 3000
  @ensure_https = false
end

Public Instance Methods

body_parameters() click to toggle source

Values of body parameters as a Hash

# File lib/recombee_api_client/api/recommend_next_items.rb, line 51
def body_parameters
  p = Hash.new
  p['count'] = @count
  p
end
method() click to toggle source

HTTP method

# File lib/recombee_api_client/api/recommend_next_items.rb, line 46
def method
  :post
end
path() click to toggle source

Relative path to the endpoint

# File lib/recombee_api_client/api/recommend_next_items.rb, line 65
def path
  "/{databaseId}/recomms/next/items/#{@recomm_id}"
end
query_parameters() click to toggle source

Values of query parameters as a Hash. name of parameter => value of the parameter

# File lib/recombee_api_client/api/recommend_next_items.rb, line 59
def query_parameters
  params = {}
  params
end