Namespace: storeOrganizeApi

Playbasis. storeOrganizeApi

Playbasis Store Organize API

Methods


<static> addContentToNode(nodeId, contentNodeId)

Add content to specific node

Parameters:
Name Type Description
nodeId String

node id

contentNodeId String

node id of content

Returns:

Promise object

Type
Object

<static> addPlayerToNode(nodeId, playerId)

Add player to specific node.

Parameters:
Name Type Description
nodeId String

node id to add player

playerId String

player id

Returns:

Promise object

Type
Object

<static> findChildNodes(nodeId, layer)

Find all child nodes under specific node.

Parameters:
Name Type Description
nodeId String

node id to find child nodes

layer Number

layer of nodes under specific node to find. Set to 0 to find for all layers.

Returns:

Promise object

Type
Object

<static> listNodes(options)

List nodes as set from admin dashboard.

Parameters:
Name Type Description
options Object

(optional) options as object.
It can include
{
id: String = node id to retrieve,
organize_id: String = organize id,
search: String = organize name to search,
sort: String = field to be sorted "name" | "status" | "description" | "date_added" | "date_modified",
order: String = "asc" | "desc",
offset: Number = offset of returned records,
limit: Number = number of returned records
}

Returns:

Promise object

Type
Object

<static> listOrganizations(options)

List organizations as set from admin dashboard.

Parameters:
Name Type Description
options Object

(optional) options as object.
It can include
{
id: String = organize id to retrieve,
search: String = organize name to search,
sort: String = field to be sorted "name" | "status" | "description" | "date_added" | "date_modified",
order: String = "asc" | "desc",
offset: Number = offset of returned records,
limit: Number = number of returned records
}

Returns:

Promise object

Type
Object

<static> listPlayerFromNode(nodeId, options)

Get player's list from specific node.

Parameters:
Name Type Description
nodeId String

node id to get list of player from

options Object

(optional) options as object.
It can include
{
role: String = role name to query
}

Returns:

Promise object

Type
Object

<static> peerLeaderboard(nodeId, rankBy, options)

Return leaderboard list for organization under given node id

Parameters:
Name Type Description
nodeId String

node id to return leaderboard from

rankBy String

name of point-based reward to rank players by

options Object

(optional) options as object.
It can include
{
page: Number = select page to be reported, page 0 is the first page. Default is 0.
limit: Number = number of results to return. Default is 20.
under_org: String = "true" to return rank of organize under given node_id | "false" to rank associate with given node_id
role: String = role to be filtered
player_id: String = player id to return his/her own rank
month: String = month to rank players by which can be "01" | "02" | ... | "12"
year: String = year to rank players by i.e. "2015"
}

Returns:

Promise object

Type
Object

<static> peerLeaderboardByAction(nodeId, action, parameter, options)

Return leaderboard list for organization under given node id ranking according to action name.

Parameters:
Name Type Description
nodeId String

node id to return leaderboard from

action String

action name to rank players

parameter String

name of parameter of action to rank players by

options Object

(optional) options as object.
It can include
{
page: Number = select page to be reported, page 0 is the first page. Default is 0.
limit: Number = number of results to return. Default is 20.
role: String = role to be filtered
player_id: String = player id to return his/her own rank
month: String = month to rank players by which can be "01" | "02" | ... | "12"
year: String = year to rank players by i.e. "2015" }

Returns:

Promise object

Type
Object

<static> removeContentFromNode(nodeId, contentNodeId)

Remove content from specific node

Parameters:
Name Type Description
nodeId String

node id

contentNodeId String

node id of content

Returns:

Promise object

Type
Object

<static> removePlayerFromNode(nodeId, playerId)

Remove player from node.

Parameters:
Name Type Description
nodeId String

node id to remove player from

playerId String

player id

Returns:

Promise object

Type
Object

<static> saleBoard(nodeId, layer, options)

Leaderboard by sale amount of all nodes under specific node.

Parameters:
Name Type Description
nodeId String

node id to find child nodes

layer Number

layer of nodes under specific node to find. Set to 0 for finding all layers.

options Object

(optional) options as object.
It can include
{
month: String = month to get sale report ex. "01" | "02" | ... | "12". Default is current month.
year: String = year to get sale report ex. "2015"
action: String = action name to query from action log
parameter: String = parameter to report from action log
page: Number = select page to be reported, page 0 is the first page. Default is 0.
limit: Number = limit per page to be reported. Default is 20.
}

Returns:

Promise object

Type
Object

<static> saleHistory(nodeId, count, options)

Sale report of specific node.

Parameters:
Name Type Description
nodeId String

node id to get sale report from

count Number

number of month to get report

options Object

(optional) options as object.
It can include
{
month: String = month to get sale report ex. "01" | "02" | ... | "12". Default is current month.
year: String = year to get sale report ex. "2015"
action: String = action name to query from action log
parameter: String = parameter to report from action log
}

Returns:

Promise object

Type
Object

<static> saleReport(nodeId, options)

Sale report of specific node in a month

Parameters:
Name Type Description
nodeId String

node id to return sale report from

options Object

(optional) options as object.
It can include
{
month: String = month to get sale report ex. "01" | "02" | ... | "12". Default is current month.
year: String = year to get sale report ex. "2015"
action: String = action name to query from action log
parameter: String = parameter to report from action log
}

Returns:

Promise object

Type
Object

<static> setContentRole(nodeId, contentNodeId, role)

Set content's organization role to specific node.

Parameters:
Name Type Description
nodeId String

node id to set role

contentNodeId String

node id of content

role String

role to set to content

Returns:

Promise object

Type
Object

<static> setPlayerRole(nodeId, playerId, role)

Set player's organization role to specific node.

Parameters:
Name Type Description
nodeId String

node id

playerId String

player id to set role

role String

role name to set player's role

Returns:

Promise object

Type
Object

<static> unsetContentRole(nodeId, contentNodeId, role)

Unset content's organization role to specific node.

Parameters:
Name Type Description
nodeId String

node id to set role

contentNodeId String

node id of content

role String

role to set to content

Returns:

Promise object

Type
Object

<static> unsetPlayerRole(nodeId, playerId, role)

Unset player's organization role from specific node.

Parameters:
Name Type Description
nodeId Strinh

node id

playerId String

player id to unset role from

role String

role name to unset player's role

Returns:

Promise object

Type
Object