Namespace: engineApi

Playbasis. engineApi

Playbasis Engine API

Methods


<static> listRules(options)

Return list of active game rules defined for client's website.

Parameters:
Name Type Description
options Object

(optional) options as object.
It can include
{
action: String = name of action performed,
player_id: String = player id as used in client's website
}

Returns:

Promise object

Type
Object

<static> listRules(ruleId, options)

Get the detail of rule.

Parameters:
Name Type Description
ruleId String

rule id

options Object

(optional) options as object.
It can include
{
player_id: String = player id as used in client's website
}

Returns:

Promise object

Type
Object

<static> rule(action, playerId, options)

Process an action through all the game rules defined for a client's website.

Parameters:
Name Type Description
action String

name of action performed

playerId String

player id

options Object

(optional) options as object.
It can include
{
url: String = URL of the page that trigger the action or any identifier string - Used for logging or URL specific rules and rules that trigger only when a specific identifier string is supplied,
reward: String = name of point-based reward to give to player - if the action trigger custom-point reward that doesn't specify reward name,
quantity: Number = amount of point-based reward to give to player,
rule_id: String = if needed then you can specifiy a rule id so that rule engine will only process against that rull,
node_id: String = if needed then you can also specify a node id so that rule engine will process with that rule,
session_id: String = you can specify a session id to extend expire session time for player
post_custom_params: Object = custom parameters that will be sent along side this request. It is Object with whose properties are your parameter-key, and values are parameter-value such as {currency: "rm", method: "top-up"}.
}

Returns:

Promise object

Type
Object