Playbasis Content Organize API
Methods
-
<static> countContent(options)
-
Count content(s) by specified filter fields.
Parameters:
Name Type Description optionsObject (optional) options as object.
It can include
{
title: String = filter title of content
category: String = filter by category of content
date_check: *String = "true" | "false" whether or not to return content that is available in this range
pin: String = secret PIN given to content
tags: *String* = tags to filter contentstatus: *String* = filter by status of content to find. Possible values are "true" | "false" | "all". Default value is "true".player_id: *String* = filter by player id associated with contentonly_new_content: *String* = "true" to display content which player does not provide any action (like/dislike) yet | "false" to display content which player has already provided an action (like/dislike)only_new_feedback`: String = "true" to display content which player does not give feedback yet | "false" to display content which player has given the feedback
}Returns:
Promise object
- Type
- Object
-
<static> createCategory(name)
-
Create content category.
Parameters:
Name Type Description nameString name of category
Returns:
Promise object
- Type
- Object
-
<static> createContent(title, summary, detail, options)
-
Create content.
Parameters:
Name Type Description titleString title of content
summaryString summary of content
detailString detail of content
optionsObject (optional) options as object.
It can include
{
node_id: String = node id of content
category: String = category of content to be in
image: String = url to the content profile image
status: String = content available status which can be "true" | "false"
date_start: String = date start in format YYYY-MM-DD (ex.1982-09-29)
date_end: String = date end in format YYYY-MM-DD (ex.1982-09-29)player_id: String = player id who generated this content
pin: String = secret PIN given to content
tags: *String* = tag(s) to add to this contentkey: *String* = custom keys separated by commavalue`: String = custom values separated by comma
}Returns:
Promise object
- Type
- Object
-
<static> deleteCategory(id)
-
Delete content category.
Parameters:
Name Type Description idString category id
Returns:
Promise object
- Type
- Object
-
<static> deleteContent(nodeId)
-
Delete existing content
Parameters:
Name Type Description nodeIdString node id of content
Returns:
Promise object
- Type
- Object
-
<static> dislikeContent(nodeId, playerId, options)
-
Send action dislike for player to content.
Parameters:
Name Type Description nodeIdString node id of content
playerIdString player id to like content
optionsObject (optional) options as object.
It can include
{
key: String = custom keys separated by comma
value: String = custom values separated by comma
}Returns:
Promise object
- Type
- Object
-
<static> giveFeedbackContent(nodeId, playerId, feedback, options)
-
Give feedback to content for player.
Parameters:
Name Type Description nodeIdString node id of content
playerIdString player id to like content
feedbackString feedback to give to content
optionsObject (optional) options as object.
It can include
{
key: String = custom keys separated by comma
value: String = custom values separated by comma
}Returns:
Promise object
- Type
- Object
-
<static> likeContent(nodeId, playerId, options)
-
Send action like for player to content.
Parameters:
Name Type Description nodeIdString node id of content
playerIdString player id to like content
optionsObject (optional) options as object.
It can include
{
key: String = custom keys separated by comma
value: String = custom values separated by comma
}Returns:
Promise object
- Type
- Object
-
<static> retrieveCategory(options)
-
Retrieve category by specified filter fields.
Parameters:
Name Type Description optionsObject (optional) options as object.
It can include
{
id: String = specific id of category
name: String = specific name of category
sort: String = specific field to sort "_id" | "name" | "date_added" | "date_modified"order: String = direction of order "asc" | "desc"
offset: Number = number of starting recordslimit: Number = number of results to return
}Returns:
Promise object
- Type
- Object
-
<static> retrieveContent(options)
-
Retrieve content(s) by specified filter fields
Parameters:
Name Type Description optionsObject (optional) options as object.
It can include
{
node_id: String = filter by node id of content
title: String = filter title of content
category: String = filter by category of content
date_check: *String = "true" | "false" whether or not to return content that is available in this range
sort: String = field to sort. It can be "title" | "date_start" | "date_end" | "date_added" | "date_modified" | "random" | "followup" | "action"
order: String = direction of order results which can be "asc" | "desc". If sort is "random", then this field will be seed number.
offset: Number = offset of starting returned records. Default is 0.
limit: Number = Number of results to return. Default is 20.
full_html: String = "true" | "false" whether or not to return full html
pin: String = secret PIN given to content
tags: *String* = tags to filter contentstatus: *String* = filter by status of content to find. Possible values are "true" | "false" | "all". Default value is "true".player_id: *String* = filter by player id associated with contentonly_new_content: *String* = "true" to display content which player does not provide any action (like/dislike) yet | "false" to display content which player has already provided an action (like/dislike)only_new_feedback`: String = "true" to display content which player does not give feedback yet | "false" to display content which player has given the feedback
}Returns:
Promise object
- Type
- Object
-
<static> updateCategory(id, name)
-
Update content category.
Parameters:
Name Type Description idString category id
nameString category name to update
Returns:
Promise object
- Type
- Object
-
<static> updateContent(nodeId, updates)
-
Update content by content id
Parameters:
Name Type Description nodeIdString node id of content
updatesObject updates as object.
It can include
{
title: String = title of content
summary: String = summary of content
detail: String = detail of content
category: String = category of content to be in
image: String = url to the content profile image
status: String = content available status which can be "true" | "false"
date_start: String = date start in format YYYY-MM-DD (ex.1982-09-29)
date_end: String = date end in format YYYY-MM-DD (ex.1982-09-29)pin: String = secret PIN given to content
tags: *String* = tag(s) to add to this contentkey: *String* = custom keys separated by commavalue`: String = custom values separated by comma
}Returns:
Promise object
- Type
- Object