Recombee API client

SetViewPortion extends 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.

Table of Contents

$additional_data  : array<string|int, mixed>
$cascade_create  : bool
$ensure_https  : bool
$item_id  : string
$optional  : array<string|int, mixed>
$portion  : float
$recomm_id  : string
$session_id  : string
$timeout  : int
$timestamp  : string|float
$user_id  : string
__construct()  : mixed
Construct the request
getBodyParameters()  : array<string|int, mixed>
Get body parameters
getEnsureHttps()  : bool
Returns true if HTTPS must be chosen over HTTP for this request
getMethod()  : static
Get used HTTP method
getPath()  : string
Get URI to the endpoint
getQueryParameters()  : array<string|int, mixed>
Get query parameters
getTimeout()  : int
Get request timeout
setEnsureHttps()  : mixed
Sets if HTTPS must be chosen over HTTP for this request
setTimeout()  : mixed
Sets request timeout

Properties

$additional_data

protected array<string|int, mixed> $additional_data

$ensure_https

protected bool $ensure_https

Methods

__construct()

Construct the request

public __construct(string $user_id, string $item_id, float $portion[, array<string|int, mixed> $optional = array() ]) : mixed
Parameters
$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<string|int, mixed> = 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.
    • additionalData
      • Type: array
      • Description: A dictionary of additional data for the interaction.
Tags
throws
UnknownOptionalParameterException

UnknownOptionalParameterException if an unknown optional parameter is given in $optional

Return values
mixed

getBodyParameters()

Get body parameters

public getBodyParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

getEnsureHttps()

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

public getEnsureHttps() : bool
Return values
bool

true if HTTPS must be chosen

getMethod()

Get used HTTP method

public getMethod() : static
Return values
static

Used HTTP method

getPath()

Get URI to the endpoint

public getPath() : string
Return values
string

URI to the endpoint

getQueryParameters()

Get query parameters

public getQueryParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

getTimeout()

Get request timeout

public getTimeout() : int
Return values
int

Request timeout in milliseconds

setEnsureHttps()

Sets if HTTPS must be chosen over HTTP for this request

public setEnsureHttps(mixed $ensure_https) : mixed
Parameters
$ensure_https : mixed
Return values
mixed

setTimeout()

Sets request timeout

public setTimeout(mixed $timeout) : mixed
Parameters
$timeout : mixed
Return values
mixed

Search results