User-Item Interactions

The following methods allow adding, deleting, and listing interactions between the users and the items.

post
Allowed on Client-Side

Adds a detail view of the given item made by the given user.

Copy
Initialization
client.send(new recombee.AddDetailView(userId, itemId, {
  // optional parameters:
  timestamp: '2022-05-13T18:25:43Z',                 // string / number
  duration: 35,                                      // integer
  cascadeCreate: true,                               // boolean
  recommId: 'ce52ada4-e4d9-4885-943c-407db2dee837',  // string
  additionalData: {},                                // Object
  autoPresented: false,                              // boolean
}));

String
Located in: path
Required: Yes

ID of your database.


String
Located in: body
Required: Yes

User who viewed the item


String
Located in: body
Required: Yes

Viewed item


String
Number
Located in: body
Required: No

UTC timestamp of the view as ISO8601-1 pattern or UTC epoch time. The default value is the current time.


Integer
Located in: body
Required: No

Duration of the view


Boolean
Located in: body
Required: No

Sets whether the given user/item should be created if not present in the database.


String
Located in: body
Required: No
Since version: 2.2.0

If this detail view is based on a recommendation request, recommId is the id of the clicked recommendation.


Object
Located in: body
Required: No
Since version: 2.3.0

Additional data associated with the interaction. The expected structure is defined for specific use cases and will be provided by the Recombee Support team when applicable.


Boolean
Located in: body
Required: No
Since version: 6.0.0

Indicates whether the item was automatically presented to the user (e.g., in a swiping feed) or explicitly requested by the user (e.g., by clicking on a link). Defaults to false.


Successful operation.


Given userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$. timestamp or duration is not a real number ≥ 0.


The cascadeCreate is not set true and the userId or the itemId were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


A detail view of the exact same userId, itemId, and timestamp is already present in the database. Note that a user may view an item's details multiple times, yet triplets (userId, itemId, timestamp) must be unique. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.


delete

Deletes an existing detail view uniquely specified by (userId, itemId, and timestamp) or all the detail views with the given userId and itemId if timestamp is omitted.

Copy
Initialization
client.send(new requests.DeleteDetailView(userId, itemId, {
  // optional parameters:
  timestamp: 1652466343,  // number
}));

1000

String
Located in: path
Required: Yes

ID of your database.


String
Located in: query
Required: Yes

ID of the user who made the detail view.


String
Located in: query
Required: Yes

ID of the item whose details were viewed.


Number
Located in: query
Required: No

Unix timestamp of the detail view. If the timestamp is omitted, then all the detail views with the given userId and itemId are deleted.


Successful operation.


Given userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, or timestamp is not a real number ≥ 0.


The userId, itemId, or detail view with the given (userId, itemId, timestamp) not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the detail views of the given item ever made by different users.

Copy
Initialization
const result = await client.send(new requests.ListItemDetailViews(itemId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the item whose detail views are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "duration": 14.23,
    "autoPresented": true,
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-x",
    "userId": "user-b",
    "duration": null,
    "autoPresented": false,
    "timestamp": 1348239363.0
  }
]

The itemId does not match ^[a-zA-Z0-9_-:@.]+$.


Given itemId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the detail views of different items ever made by the given user.

Copy
Initialization
const result = await client.send(new requests.ListUserDetailViews(userId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the user whose detail views are to be listed.


Successful operation.

[
  {
    "itemId": "item-y",
    "userId": "user-a",
    "duration": 134.03,
    "autoPresented": true,
    "timestamp": 1348139180.0
  },
  {
    "itemId": "item-x",
    "userId": "user-a",
    "duration": 14.23,
    "autoPresented": false,
    "timestamp": 1348151906.0
  }
]

The userId does not match ^[a-zA-Z0-9_-:@.]+$.


Given userId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


post
Allowed on Client-Side

Adds a purchase of the given item made by the given user.

Copy
Initialization
client.send(new recombee.AddPurchase(userId, itemId, {
  // optional parameters:
  timestamp: '2022-05-13T18:25:43Z',                 // string / number
  cascadeCreate: true,                               // boolean
  amount: 1,                                         // number
  price: 25.0,                                       // number
  profit: 5.0,                                       // number
  recommId: 'ce52ada4-e4d9-4885-943c-407db2dee837',  // string
  additionalData: {},                                // Object
}));

String
Located in: path
Required: Yes

ID of your database.


String
Located in: body
Required: Yes

User who purchased the item


String
Located in: body
Required: Yes

Purchased item


String
Number
Located in: body
Required: No

UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.


Boolean
Located in: body
Required: No

Sets whether the given user/item should be created if not present in the database.


Number
Located in: body
Required: No
Since version: 1.6.0

Amount (number) of purchased items. The default is 1. For example, if user-x purchases two item-y during a single order (session...), the amount should equal 2.


Number
Located in: body
Required: No
Since version: 1.6.0

Price paid by the user for the item. If amount is greater than 1, the sum of prices of all the items should be given.


Number
Located in: body
Required: No
Since version: 1.6.0

Your profit from the purchased item. The profit is natural in the e-commerce domain (for example, if user-x purchases item-y for $100 and the gross margin is 30 %, then the profit is $30) but is also applicable in other domains (for example, at a news company it may be income from a displayed advertisement on article page). If amount is greater than 1, the sum of profit of all the items should be given.


String
Located in: body
Required: No
Since version: 2.2.0

If this purchase is based on a recommendation request, recommId is the id of the clicked recommendation.


Object
Located in: body
Required: No
Since version: 2.3.0

Additional data associated with the interaction. The expected structure is defined for specific use cases and will be provided by the Recombee Support team when applicable.


Successful operation.


The userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$. timestamp is not a real number ≥ 0.


The cascadeCreate is not set true and the userId or the itemId were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


A purchase of the exact same userId, itemId, and timestamp is already present in the database. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.


delete

Deletes an existing purchase uniquely specified by userId, itemId, and timestamp or all the purchases with the given userId and itemId if timestamp is omitted.

Copy
Initialization
client.send(new requests.DeletePurchase(userId, itemId, {
  // optional parameters:
  timestamp: 1652466343,  // number
}));

1000

String
Located in: path
Required: Yes

ID of your database.


String
Located in: query
Required: Yes

ID of the user who made the purchase.


String
Located in: query
Required: Yes

ID of the item which was purchased.


Number
Located in: query
Required: No

Unix timestamp of the purchase. If the timestamp is omitted, then all the purchases with the given userId and itemId are deleted.


Successful operation.


Given userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, or timestamp is not a real number ≥ 0.


The userId, itemId, or purchase with the given (userId, itemId, timestamp) not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the ever-made purchases of the given item.

Copy
Initialization
const result = await client.send(new requests.ListItemPurchases(itemId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the item whose purchases are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-x",
    "userId": "user-b",
    "timestamp": 1348327154.0
  }
]

The itemId does not match ^[a-zA-Z0-9_-:@.]+$.


Given itemId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the purchases ever made by the given user.

Copy
Initialization
const result = await client.send(new requests.ListUserPurchases(userId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the user whose purchases are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "timestamp": 1348151906.0,
    "userId": "user-a"
  },
  {
    "itemId": "item-z",
    "timestamp": 1348239363.0,
    "userId": "user-a"
  }
]

The userId does not match ^[a-zA-Z0-9_-:@.]+$.


Given userId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


post
Allowed on Client-Side

Adds a rating of the given item made by the given user.

Copy
Initialization
client.send(new recombee.AddRating(userId, itemId, rating, {
  // optional parameters:
  timestamp: '2022-05-13T18:25:43Z',                 // string / number
  cascadeCreate: true,                               // boolean
  recommId: 'ce52ada4-e4d9-4885-943c-407db2dee837',  // string
  additionalData: {},                                // Object
}));

String
Located in: path
Required: Yes

ID of your database.


String
Located in: body
Required: Yes

User who submitted the rating


String
Located in: body
Required: Yes

Rated item


String
Number
Located in: body
Required: No

UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.


Number
Located in: body
Required: Yes

Rating rescaled to interval [-1.0,1.0], where -1.0 means the worst rating possible, 0.0 means neutral, and 1.0 means absolutely positive rating. For example, in the case of 5-star evaluations, rating = (numStars-3)/2 formula may be used for the conversion.


Boolean
Located in: body
Required: No

Sets whether the given user/item should be created if not present in the database.


String
Located in: body
Required: No
Since version: 2.2.0

If this rating is based on a recommendation request, recommId is the id of the clicked recommendation.


Object
Located in: body
Required: No
Since version: 2.3.0

Additional data associated with the interaction. The expected structure is defined for specific use cases and will be provided by the Recombee Support team when applicable.


Successful operation.


The userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, or rating is not a real number from [-1.0,1.0], or timestamp is not a real number ≥ 0.


The cascadeCreate is not set true and the userId or the itemId were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


A rating of the exact same userId, itemId, and timestamp is already present in the database. Note that a user may rate an item multiple times, yet triplets (userId, itemId, timestamp) must be unique. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.


delete

Deletes an existing rating specified by (userId, itemId, timestamp) from the database or all the ratings with the given userId and itemId if timestamp is omitted.

Copy
Initialization
client.send(new requests.DeleteRating(userId, itemId, {
  // optional parameters:
  timestamp: 1652466343,  // number
}));

1000

String
Located in: path
Required: Yes

ID of your database.


String
Located in: query
Required: Yes

ID of the user who rated the item.


String
Located in: query
Required: Yes

ID of the item which was rated.


Number
Located in: query
Required: No

Unix timestamp of the rating. If the timestamp is omitted, then all the ratings with the given userId and itemId are deleted.


Successful operation.


Given userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, or timestamp is not a real number ≥ 0.


The userId, itemId or rating with the given (userId, itemId, timestamp) not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the ratings of an item ever submitted by different users.

Copy
Initialization
const result = await client.send(new requests.ListItemRatings(itemId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the item whose ratings are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "rating": -0.25,
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-x",
    "userId": "user-b",
    "rating": 0.0,
    "timestamp": 1348239363.0
  }
]

The itemId does not match ^[a-zA-Z0-9_-:@.]+$.


Given itemId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the ratings ever submitted by the given user.

Copy
Initialization
const result = await client.send(new requests.ListUserRatings(userId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the user whose ratings are to be listed.


Successful operation.

[
  {
    "itemId": "item-y",
    "userId": "user-a",
    "rating": 0.5,
    "timestamp": 1348139180.0
  },
  {
    "itemId": "item-x",
    "userId": "user-a",
    "rating": -0.25,
    "timestamp": 1348151906.0
  }
]

The userId does not match ^[a-zA-Z0-9_-:@.]+$.


Given userId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


post
Allowed on Client-Side

Adds a cart addition of the given item made by the given user.

Copy
Initialization
client.send(new recombee.AddCartAddition(userId, itemId, {
  // optional parameters:
  timestamp: '2022-05-13T18:25:43Z',                 // string / number
  cascadeCreate: true,                               // boolean
  amount: 1,                                         // number
  price: 25.0,                                       // number
  recommId: 'ce52ada4-e4d9-4885-943c-407db2dee837',  // string
  additionalData: {},                                // Object
}));

String
Located in: path
Required: Yes

ID of your database.


String
Located in: body
Required: Yes

User who added the item to the cart


String
Located in: body
Required: Yes

Item added to the cart


String
Number
Located in: body
Required: No

UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.


Boolean
Located in: body
Required: No

Sets whether the given user/item should be created if not present in the database.


Number
Located in: body
Required: No
Since version: 1.6.0

Amount (number) added to cart. The default is 1. For example, if user-x adds two item-y during a single order (session...), the amount should equal 2.


Number
Located in: body
Required: No
Since version: 1.6.0

Price of the added item. If amount is greater than 1, the sum of prices of all the items should be given.


String
Located in: body
Required: No
Since version: 2.2.0

If this cart addition is based on a recommendation request, recommId is the id of the clicked recommendation.


Object
Located in: body
Required: No
Since version: 2.3.0

Additional data associated with the interaction. The expected structure is defined for specific use cases and will be provided by the Recombee Support team when applicable.


Successful operation.


The userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, timestamp is not a real number ≥ 0.


The cascadeCreate is not set true and the userId or the itemId were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


A cart addition of the exact same userId, itemId, and timestamp is already present in the database. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.


delete

Deletes an existing cart addition uniquely specified by userId, itemId, and timestamp or all the cart additions with the given userId and itemId if timestamp is omitted.

Copy
Initialization
client.send(new requests.DeleteCartAddition(userId, itemId, {
  // optional parameters:
  timestamp: 1652466343,  // number
}));

1000

String
Located in: path
Required: Yes

ID of your database.


String
Located in: query
Required: Yes

ID of the user who made the cart addition.


String
Located in: query
Required: Yes

ID of the item which was added to the cart.


Number
Located in: query
Required: No

Unix timestamp of the cart addition. If the timestamp is omitted, then all the cart additions with the given userId and itemId are deleted.


Successful operation.


Given userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, or timestamp is not a real number ≥ 0.


The userId, itemId, or cart addition with the given (userId, itemId, timestamp) not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the ever-made cart additions of the given item.

Copy
Initialization
const result = await client.send(new requests.ListItemCartAdditions(itemId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the item whose cart additions are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-x",
    "userId": "user-a",
    "timestamp": 1348327154.0
  }
]

The itemId does not match ^[a-zA-Z0-9_-:@.]+$.


Given itemId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the cart additions ever made by the given user.

Copy
Initialization
const result = await client.send(new requests.ListUserCartAdditions(userId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the user whose cart additions are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "timestamp": 1348151906.0,
    "userId": "user-a"
  },
  {
    "itemId": "item-z",
    "timestamp": 1348239363.0,
    "userId": "user-a"
  }
]

The userId does not match ^[a-zA-Z0-9_-:@.]+$.


Given userId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


post
Allowed on Client-Side

Adds a bookmark of the given item made by the given user.

Copy
Initialization
client.send(new recombee.AddBookmark(userId, itemId, {
  // optional parameters:
  timestamp: '2022-05-13T18:25:43Z',                 // string / number
  cascadeCreate: true,                               // boolean
  recommId: 'ce52ada4-e4d9-4885-943c-407db2dee837',  // string
  additionalData: {},                                // Object
}));

String
Located in: path
Required: Yes

ID of your database.


String
Located in: body
Required: Yes

User who bookmarked the item


String
Located in: body
Required: Yes

Bookmarked item


String
Number
Located in: body
Required: No

UTC timestamp of the bookmark as ISO8601-1 pattern or UTC epoch time. The default value is the current time.


Boolean
Located in: body
Required: No

Sets whether the given user/item should be created if not present in the database.


String
Located in: body
Required: No
Since version: 2.2.0

If this bookmark is based on a recommendation request, recommId is the id of the clicked recommendation.


Object
Located in: body
Required: No
Since version: 2.3.0

Additional data associated with the interaction. The expected structure is defined for specific use cases and will be provided by the Recombee Support team when applicable.


Successful operation.


The userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, timestamp is not a real number ≥ 0.


The cascadeCreate is not set true and the userId or the itemId were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


A bookmark of the exact same userId, itemId, and timestamp is already present in the database. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.


delete

Deletes a bookmark uniquely specified by userId, itemId, and timestamp or all the bookmarks with the given userId and itemId if timestamp is omitted.

Copy
Initialization
client.send(new requests.DeleteBookmark(userId, itemId, {
  // optional parameters:
  timestamp: 1652466343,  // number
}));

1000

String
Located in: path
Required: Yes

ID of your database.


String
Located in: query
Required: Yes

ID of the user who made the bookmark.


String
Located in: query
Required: Yes

ID of the item which was bookmarked.


Number
Located in: query
Required: No

Unix timestamp of the bookmark. If the timestamp is omitted, then all the bookmarks with the given userId and itemId are deleted.


Successful operation.


Given userId or itemId does not match ^[a-zA-Z0-9_-:@.]+$, or timestamp is not a real number ≥ 0.


The userId, itemId, or bookmark with the given (userId, itemId, timestamp) not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the ever-made bookmarks of the given item.

Copy
Initialization
const result = await client.send(new requests.ListItemBookmarks(itemId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the item whose bookmarks are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-x",
    "userId": "user-a",
    "timestamp": 1348327154.0
  }
]

The itemId does not match ^[a-zA-Z0-9_-:@.]+$.


Given itemId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the bookmarks ever made by the given user.

Copy
Initialization
const result = await client.send(new requests.ListUserBookmarks(userId));

60

String
Located in: path
Required: Yes

ID of your database.


String
Located in: path
Required: Yes

ID of the user whose bookmarks are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "timestamp": 1348151906.0,
    "userId": "user-a"
  },
  {
    "itemId": "item-z",
    "timestamp": 1348239363.0,
    "userId": "user-a"
  }
]

The userId does not match ^[a-zA-Z0-9_-:@.]+$.


Given userId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


post
Allowed on Client-Side

Sets viewed portion of an item (for example a video or article) by a user (at a session). If you send a new request with the same (userId, itemId, sessionId), the portion gets updated.

Copy
Initialization
client.send(new recombee.SetViewPortion(userId, itemId, portion, {
  // optional parameters:
  sessionId: 'ABAD1D',                               // string
  timestamp: '2022-05-13T18:25:43Z',                 // string / number
  cascadeCreate: true,                               // boolean
  recommId: 'ce52ada4-e4d9-4885-943c-407db2dee837',  // string
  additionalData: {},                                // Object
  autoPresented: false,                              // boolean
  timeSpent: 42,                                     // number
}));

2.1.0

String
Located in: path
Required: Yes
Since version: 2.1.0

ID of your database.


String
Located in: body
Required: Yes
Since version: 2.1.0

User who viewed a portion of the item


String
Located in: body
Required: Yes
Since version: 2.1.0

Viewed item


Number
Located in: body
Required: Yes
Since version: 2.1.0

Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the actual viewed part of the item, no matter the seeking. For example, if the user seeked immediately to half of the item and then viewed 10% of the item, the portion should still be 0.1.


String
Located in: body
Required: No
Since version: 2.1.0

ID of the session in which the user viewed the item. Default is null (None, nil, NULL etc., depending on the language).


String
Number
Located in: body
Required: No
Since version: 2.1.0

UTC timestamp of the view portion as ISO8601-1 pattern or UTC epoch time. The default value is the current time.


Boolean
Located in: body
Required: No
Since version: 2.1.0

Sets whether the given user/item should be created if not present in the database.


String
Located in: body
Required: No
Since version: 2.2.0

If this view portion is based on a recommendation request, recommId is the id of the clicked recommendation.


Object
Located in: body
Required: No
Since version: 2.3.0

Additional data associated with the interaction. The expected structure is defined for specific use cases and will be provided by the Recombee Support team when applicable.


Boolean
Located in: body
Required: No
Since version: 6.0.0

Indicates whether the item was automatically presented to the user (e.g., in a swiping feed) or explicitly requested by the user (e.g., by clicking on a link). Defaults to false.


Number
Located in: body
Required: No
Since version: 6.0.0

The duration (in seconds) that the user viewed the item. In update requests, this value may only increase and is required only if it has changed.


Successful operation.


The userId, itemId or sessionId does not match ^[a-zA-Z0-9_-:@.]+$, or the portion is not a real number from [0.0,1.0].


The cascadeCreate is not set true and the userId or the itemId were found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


A view portion of the exact same userId, itemId, and a greater or equal timestamp (or a greater portion) is already present in the database. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.


delete

Deletes an existing view portion specified by (userId, itemId, sessionId) from the database.

Copy
Initialization
client.send(new requests.DeleteViewPortion(userId, itemId, {
  // optional parameters:
  sessionId: 'ABAD1D',  // string
}));

2.1.0

1000

String
Located in: path
Required: Yes
Since version: 2.1.0

ID of your database.


String
Located in: query
Required: Yes
Since version: 2.1.0

ID of the user who rated the item.


String
Located in: query
Required: Yes
Since version: 2.1.0

ID of the item which was rated.


String
Located in: query
Required: No
Since version: 2.1.0

Identifier of a session.


Successful operation.


Given userId, itemId or sessionId does not match ^[a-zA-Z0-9_-:@.]+$.


The userId, itemId or view portion with the given (userId, itemId, sessionId) not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the view portions of an item ever submitted by different users.

Copy
Initialization
const result = await client.send(new requests.ListItemViewPortions(itemId));

2.1.0

60

String
Located in: path
Required: Yes
Since version: 2.1.0

ID of your database.


String
Located in: path
Required: Yes
Since version: 2.1.0

ID of the item whose view portions are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "sessionId": "ABAD1D",
    "portion": 0.5,
    "autoPresented": true,
    "timeSpent": 40.5,
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-x",
    "userId": "user-b",
    "sessionId": null,
    "portion": 1,
    "autoPresented": false,
    "timeSpent": 0,
    "timestamp": 1348239363.0
  }
]

The itemId does not match ^[a-zA-Z0-9_-:@.]+$.


Given itemId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


get

Lists all the view portions ever submitted by the given user.

Copy
Initialization
const result = await client.send(new requests.ListUserViewPortions(userId));

2.1.0

60

String
Located in: path
Required: Yes
Since version: 2.1.0

ID of your database.


String
Located in: path
Required: Yes
Since version: 2.1.0

ID of the user whose view portions are to be listed.


Successful operation.

[
  {
    "itemId": "item-x",
    "userId": "user-a",
    "sessionId": "ABAD1D",
    "portion": 0.25,
    "autoPresented": false,
    "timeSpent": 1.5,
    "timestamp": 1348151906.0
  },
  {
    "itemId": "item-y",
    "userId": "user-a",
    "sessionId": "EWQKOL",
    "portion": 0.1,
    "autoPresented": true,
    "timeSpent": 231.25,
    "timestamp": 1348239363.0
  }
]

The userId does not match ^[a-zA-Z0-9_-:@.]+$.


Given userId not found in the database. If there is no additional info in the JSON response, you probably have an error in your URL.


© Copyright 2026, Recombee s.r.o
docs.recombee.com