User-Item Interactions
The following methods allow adding, deleting, and listing interactions between the users and the items.
Detail Views
Add Detail View
Adds a detail view of the given item made by the given user.
Parameters
ID of your database.
User who viewed the item
Viewed item
UTC timestamp of the view as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
Duration of the view
Sets whether the given user/item should be created if not present in the database.
If this detail view is based on a recommendation request, recommId is the id of the clicked recommendation.
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.
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.
Responses
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 Detail View
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.
Parameters
ID of your database.
ID of the user who made the detail view.
ID of the item whose details were viewed.
Unix timestamp of the detail view. If the timestamp is omitted, then all the detail views with the given userId and itemId are deleted.
Responses
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.
List Item Detail Views
Lists all the detail views of the given item ever made by different users.
Parameters
ID of your database.
ID of the item whose detail views are to be listed.
Responses
Successful operation.
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.
List User Detail Views
Lists all the detail views of different items ever made by the given user.
Parameters
ID of your database.
ID of the user whose detail views are to be listed.
Responses
Successful operation.
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.
Purchases
Add Purchase
Adds a purchase of the given item made by the given user.
Parameters
ID of your database.
User who purchased the item
Purchased item
UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
Sets whether the given user/item should be created if not present in the database.
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.
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.
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.
If this purchase is based on a recommendation request, recommId is the id of the clicked recommendation.
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.
Responses
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 Purchase
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.
Parameters
ID of your database.
ID of the user who made the purchase.
ID of the item which was purchased.
Unix timestamp of the purchase. If the timestamp is omitted, then all the purchases with the given userId and itemId are deleted.
Responses
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.
List Item Purchases
Lists all the ever-made purchases of the given item.
Parameters
ID of your database.
ID of the item whose purchases are to be listed.
Responses
Successful operation.
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.
List User Purchases
Lists all the purchases ever made by the given user.
Parameters
ID of your database.
ID of the user whose purchases are to be listed.
Responses
Successful operation.
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.
Ratings
Add Rating
Adds a rating of the given item made by the given user.
Parameters
ID of your database.
User who submitted the rating
Rated item
UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
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.
Sets whether the given user/item should be created if not present in the database.
If this rating is based on a recommendation request, recommId is the id of the clicked recommendation.
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.
Responses
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 Rating
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.
Parameters
ID of your database.
ID of the user who rated the item.
ID of the item which was rated.
Unix timestamp of the rating. If the timestamp is omitted, then all the ratings with the given userId and itemId are deleted.
Responses
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.
List Item Ratings
Lists all the ratings of an item ever submitted by different users.
Parameters
ID of your database.
ID of the item whose ratings are to be listed.
Responses
Successful operation.
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.
List User Ratings
Lists all the ratings ever submitted by the given user.
Parameters
ID of your database.
ID of the user whose ratings are to be listed.
Responses
Successful operation.
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.
Cart Additions
Add Cart Addition
Adds a cart addition of the given item made by the given user.
Parameters
ID of your database.
User who added the item to the cart
Item added to the cart
UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
Sets whether the given user/item should be created if not present in the database.
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.
Price of the added item. If amount is greater than 1, the sum of prices of all the items should be given.
If this cart addition is based on a recommendation request, recommId is the id of the clicked recommendation.
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.
Responses
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 Cart Addition
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.
Parameters
ID of your database.
ID of the user who made the cart addition.
ID of the item which was added to the cart.
Unix timestamp of the cart addition. If the timestamp is omitted, then all the cart additions with the given userId and itemId are deleted.
Responses
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.
List Item Cart Additions
Lists all the ever-made cart additions of the given item.
Parameters
ID of your database.
ID of the item whose cart additions are to be listed.
Responses
Successful operation.
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.
List User Cart Additions
Lists all the cart additions ever made by the given user.
Parameters
ID of your database.
ID of the user whose cart additions are to be listed.
Responses
Successful operation.
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.
Bookmarks
Add Bookmark
Adds a bookmark of the given item made by the given user.
Parameters
ID of your database.
User who bookmarked the item
Bookmarked item
UTC timestamp of the bookmark as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
Sets whether the given user/item should be created if not present in the database.
If this bookmark is based on a recommendation request, recommId is the id of the clicked recommendation.
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.
Responses
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 Bookmark
Deletes a bookmark uniquely specified by userId, itemId, and timestamp or all the bookmarks with the given userId and itemId if timestamp is omitted.
Parameters
ID of your database.
ID of the user who made the bookmark.
ID of the item which was bookmarked.
Unix timestamp of the bookmark. If the timestamp is omitted, then all the bookmarks with the given userId and itemId are deleted.
Responses
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.
List Item Bookmarks
Lists all the ever-made bookmarks of the given item.
Parameters
ID of your database.
ID of the item whose bookmarks are to be listed.
Responses
Successful operation.
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.
List User Bookmarks
Lists all the bookmarks ever made by the given user.
Parameters
ID of your database.
ID of the user whose bookmarks are to be listed.
Responses
Successful operation.
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.
View Portions
Set View Portion
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.
Parameters
ID of your database.
User who viewed a portion of the item
Viewed item
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.
ID of the session in which the user viewed the item. Default is null (None, nil, NULL etc., depending on the language).
UTC timestamp of the view portion as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
Sets whether the given user/item should be created if not present in the database.
If this view portion is based on a recommendation request, recommId is the id of the clicked recommendation.
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.
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.
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.
Responses
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 View Portion
Deletes an existing view portion specified by (userId, itemId, sessionId) from the database.
Parameters
ID of your database.
ID of the user who rated the item.
ID of the item which was rated.
Identifier of a session.
Responses
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.
List Item View Portions
Lists all the view portions of an item ever submitted by different users.
Parameters
ID of your database.
ID of the item whose view portions are to be listed.
Responses
Successful operation.
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.
List User View Portions
Lists all the view portions ever submitted by the given user.
Parameters
ID of your database.
ID of the user whose view portions are to be listed.
Responses
Successful operation.
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.