Playbasis Store Organize API
Methods
-
<static> addContentToNode(nodeId, contentNodeId)
-
Add content to specific node
Parameters:
Name Type Description nodeIdString node id
contentNodeIdString node id of content
Returns:
Promise object
- Type
- Object
-
<static> addPlayerToNode(nodeId, playerId)
-
Add player to specific node.
Parameters:
Name Type Description nodeIdString node id to add player
playerIdString player id
Returns:
Promise object
- Type
- Object
-
<static> findChildNodes(nodeId, layer)
-
Find all child nodes under specific node.
Parameters:
Name Type Description nodeIdString node id to find child nodes
layerNumber 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 optionsObject (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 optionsObject (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 nodeIdString node id to get list of player from
optionsObject (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 nodeIdString node id to return leaderboard from
rankByString name of point-based reward to rank players by
optionsObject (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 nodeIdString node id to return leaderboard from
actionString action name to rank players
parameterString name of parameter of action to rank players by
optionsObject (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 nodeIdString node id
contentNodeIdString node id of content
Returns:
Promise object
- Type
- Object
-
<static> removePlayerFromNode(nodeId, playerId)
-
Remove player from node.
Parameters:
Name Type Description nodeIdString node id to remove player from
playerIdString 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 nodeIdString node id to find child nodes
layerNumber layer of nodes under specific node to find. Set to 0 for finding all layers.
optionsObject (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 nodeIdString node id to get sale report from
countNumber number of month to get report
optionsObject (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 nodeIdString node id to return sale report from
optionsObject (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 nodeIdString node id to set role
contentNodeIdString node id of content
roleString 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 nodeIdString node id
playerIdString player id to set role
roleString 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 nodeIdString node id to set role
contentNodeIdString node id of content
roleString 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 nodeIdStrinh node id
playerIdString player id to unset role from
roleString role name to unset player's role
Returns:
Promise object
- Type
- Object