SetViewPortion

Extends \Recombee\RecommApi\Requests\Request

Sets viewed portion of an item (for example a video or article) by a user (at a session).

If you send new request with the same (userId, itemId, sessionId), the portion gets updated.

package

Default

Methods

Construct the request

__construct(string $user_id, string $item_id, float $portion, array $optional = array()) 
Throws
\Recombee\RecommApi\Requests\Exceptions\UnknownOptionalParameterException

UnknownOptionalParameterException if an unknown optional parameter is given in $optional

Arguments

$user_id

string

User who viewed a portion of the item

$item_id

string

Viewed item

$portion

float

Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the really viewed part of the item, no matter seeking, so 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.

$optional

array

Optional parameters given as an array containing pairs name of the parameter => value

  • Allowed parameters:
    • sessionId
      • Type: string
      • Description: ID of session in which the user viewed the item. Default is null (None, nil, NULL etc. depending on language).
    • timestamp
      • Type: string|float
      • Description: UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
    • cascadeCreate
      • Type: bool
      • Description: Sets whether the given user/item should be created if not present in the database.
    • recommId
      • Type: string
      • Description: If this view portion is based on a recommendation request, recommId is the id of the clicked recommendation.

Get body parameters

getBodyParameters() : array
inherited abstract

Response

array

Values of body parameters (name of parameter => value of the parameter)

Returns true if HTTPS must be chosen over HTTP for this request

getEnsureHttps() : boolean
inherited

Response

boolean

true if HTTPS must be chosen

Get used HTTP method

getMethod() : static
inherited abstract

Response

static

Used HTTP method

Get URI to the endpoint

getPath() : string
inherited abstract

Response

string

URI to the endpoint

Get query parameters

getQueryParameters() : array
inherited abstract

Response

array

Values of query parameters (name of parameter => value of the parameter)

Get request timeout

getTimeout() : integer
inherited

Response

integer

Request timeout in milliseconds

Sets if HTTPS must be chosen over HTTP for this request

setEnsureHttps( $ensure_https) 
inherited

Arguments

$ensure_https

Sets request timeout

setTimeout( $timeout) 
inherited

Arguments

$timeout

Properties

User who viewed a portion of the item

user_id : string
var

User who viewed a portion of the item

Type(s)

string

Viewed item

item_id : string
var

Viewed item

Type(s)

string

Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the really viewed part of the item, no matter seeking, so 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`.

portion : float
var

Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the really viewed part of the item, no matter seeking, so 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.

Type(s)

float

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

session_id : string
var

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

Type(s)

string

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

timestamp : string|float
var

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

Type(s)

string|float

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

cascade_create : boolean
var

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

Type(s)

boolean

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

recomm_id : string
var

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

Type(s)

string

Array containing values of optional parameters

optional : array
var

Array containing values of optional parameters

Type(s)

array

Timeout of the request in milliseconds

timeout : integer
inherited
var

Timeout of the request in milliseconds

Type(s)

integer

Sets if the HTTPS must be chosen over HTTP for this request

ensure_https : boolean
inherited
var

Sets if the HTTPS must be chosen over HTTP for this request

Type(s)

boolean