playbasis
Version:
Playbasis Javascript SDK
10 lines (9 loc) • 77.4 kB
HTML
<html>
<head>
</head>
<body style="background: transparent;">
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/lunr.min.js"></script>
<script src="scripts/fulltext-search.js"></script>
<script type="text/x-docstrap-searchdb">
{"namespaces.list.html":{"id":"namespaces.list.html","title":"Namespaces","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespaces Namespaces Playbasis authApi badgeApi barCode builder communicationApi const contentApi engineApi goodsApi helpers http livefeedApi merchantApi playerApi pointApi qrCode questApi quizApi redeemApi serviceApi storeOrganizeApi util × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Playbasis SDK for Javascript/NodeJS npm install @playbasis1/playbasis --save var Playbasis = require('@playbasis1/playbasis'); × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.html":{"id":"Playbasis.html","title":"Namespace: Playbasis","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: Playbasis Playbasis Namespaces authApi badgeApi barCode builder communicationApi const contentApi engineApi goodsApi helpers http livefeedApi merchantApi playerApi pointApi qrCode questApi quizApi redeemApi serviceApi storeOrganizeApi util × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.authApi.html":{"id":"Playbasis.authApi.html","title":"Namespace: authApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: authApi Playbasis. authApi Playbasis Auth API Methods <static> auth() Authenticate the application to get token Returns: Promise object Type object <static> renew() Renew token Returns: Promise object Type object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.badgeApi.html":{"id":"Playbasis.badgeApi.html","title":"Namespace: badgeApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: badgeApi Playbasis. badgeApi Playbasis Badge API Methods <static> badgeInfo(badgeId) Returns information about the badge with the specified badge id. Parameters: Name Type Description badgeId String badge id to get information from Returns: Promise object Type Object <static> badgesInfo(options) Returns information about all available badges from the current site. Parameters: Name Type Description options Object (optional) options as object. It can include { tags: String = tag string which can be multiple items joined via comma } Returns: Promise object Type Object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.barCode.html":{"id":"Playbasis.barCode.html","title":"Namespace: barCode","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: barCode Playbasis. barCode Playbasis Vendors - Barcode Generator Methods <static> generate(targetElement, text, options) Generate barcode and attach result to target element. Result from this call, target element will have barcode rendered. Parameters: Name Type Description targetElement String Target element can either be \"#elementname\" or \".classname\". Use the former to render barcode to specific element. Otherwise use the latter, so you can use that class name to apply to multiple of elements. text Object Text data to add into generated qrcode options Object (optional) option as Object. It can include { format: String = select which format to use to render barcode. It can be \"UPC\" | \"EAN2\" | \"EAN5\" | \"EAN8\" | \"EAN13\" | \"CODE39\" | \"ITF14\" | \"MSI\" | \"PHARMACODE\". Otherwise if not specify, it will be default to use code-128 style. width: Number = width of single bar. Default is 2. height: Number = height of the barcode. Default is 100. text: String = override text that is displayed. Default is undefined. fontOptions: String = you can add bold, and italic style to text. It can be \"bold\" | \"italic\" | \"bold italic\". Default is \"\". font: String = define the font family used to display text. This can be any default font or a font defined by a @font-face rule. Default is \"monospace\". textAlign: String = set horizontal alignment of text. It can be \"left\" | \"center\" | \"right\". Default is \"center\". textPosition: String = set vertical position of text. It can be \"bottom\" | \"top\". Default is \"bottom\". textMargin: Number = set the space between the barcode and text. Default is 2. fontSize: Number = set size of text. Default is 20. background: String = set background color of barcode. Default is \"#ffffff\". lineColor: String = set line color of barcode. Default is \"#000000\". margin: Number = set space margin around barcode. If nothing else is set, all side will inherit the margins property but can be replaced it you want to set them separately. Default is 10. marginLeft: Number = set space margin left of barcode. Default is 10. marginRight: Number = set space margin right of barcode. Default is 10. marginTop: Number = set space margin top of barcode. Default is 10. marginBottom: Number = set space margin bottom of barcode. Default is 10. } × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.builder.html":{"id":"Playbasis.builder.html","title":"Namespace: builder","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: builder Playbasis. builder Playbasis Builder Methods <static> build() Build <static> setApiKey(apiKey) Set api key Parameters: Name Type Description apiKey String api key Returns: Playbasis.builder object. You can chain setting other properties further. Type Object <static> setApiSecret(apiSecret) Set api secret Parameters: Name Type Description apiSecret String api secret Returns: Playbasis.builder object. You can chain setting other properties further. Type Object <static> setBaseAsyncUrl(baseAsyncUrl) Set base async url Parameters: Name Type Description baseAsyncUrl String base async url Returns: Playbasis.builder object. You can chain setting other properties further. Type Object <static> setBaseUrl(baseUrl) Set base url Parameters: Name Type Description baseUrl String base url Returns: Playbasis.builder object. You can chain setting other properties further. Type Object <static> setEndpoint(endpoint) Set endpoint Parameters: Name Type Description endpoint String API endpoint Returns: Playbasis.builder object. You can chain setting other properties further. Type Object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.communicationApi.html":{"id":"Playbasis.communicationApi.html","title":"Namespace: communicationApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: communicationApi Playbasis. communicationApi Playbasis Communication API Methods <static> deregisterDevice(playerId, deviceToken) Deregister device for push notification. Either 'playerId' or 'deviceToken' is required. Parameters: Name Type Description playerId String player id. Either 'playerId' or 'deviceToken' is required. deviceToken String device token. Either 'playerId' or 'deviceToken' is required. Returns: Promise object Type Object <static> getProcessedEmailTemplate(templateId, options) Get processed email template. Parameters: Name Type Description templateId String email template id options Object (optional) options as object. It can include { player_id: String } Returns: Promise object Type Object <static> getProcessedPushNotificationTemplate(templateId, options) Get processed push notification template Parameters: Name Type Description templateId String push notification template id options Object (optional) options as object. It can include { player_id: String } Returns: Promise object Type Object <static> getProcessedSMSTemplate(templateId, options) Get processes SMS template Parameters: Name Type Description templateId String template id options Object (optional) options as object. It can include { player_id: String } Returns: Promise object Type Object <static> listPushNotificationTemplate() List push notification template Returns: Promise object Type Object <static> listRecentPushNotificationSent(playerId, options) List recent push notification sent to player Parameters: Name Type Description playerId String player id options Object (optional) options as object. It can inclue { since: String = 'datetime' format supported by any English textual datetimee description } Returns: Promise object Type Object <static> listRecentSentEmail(playerId, options) List recent email sent to player Parameters: Name Type Description playerId String player id options Object (optional) options as object. It can inclue { since: String = 'datetime' format supported by any English textual datetimee description } Returns: Promise object Type Object <static> listRecentSentEmail() List email template Returns: Promise template Type Object <static> listRecentSMSSent(playerId, options) List recent SMS sent to player Parameters: Name Type Description playerId String player id options Object (optional) options as object. It can inclue { since: String = 'datetime' format supported by any English textual datetimee description } Returns: Promise object Type Object <static> listSMSTemplate() List SMS template Returns: Promise object Type Object <static> registerDevice(playerId, deviceToken, deviceDescription, deviceName, osType) Register device for push notification Parameters: Name Type Description playerId String player id deviceToken String device token deviceDescription String device model description deviceName String device model name osType String os type. It can be \"IOS\" | \"Android\" Returns: Promise object Type Object <static> sendEmail(playerId, subject, message, templateId) Send email to player. 'message' or 'templateId' is required. There's no need to submit both values. If submit both, 'templateId' will be taken into effect but 'message'. Parameters: Name Type Description playerId String player id subject String email subject message String email message (either message or templateId is required) templateId String template message (either message or templateId is required) Returns: Promise object Type Object <static> sendEmailCoupon(playerId, refId, subject, message, templateId) Send coupon to player via email. 'message' or 'templateId' is required. There's no need to submit both values. If submit both, 'templateId' will be taken into effect but 'message'. Parameters: Name Type Description playerId String player id refId String reference transaction id for redeption subject String email subject message String email message, you can use {{coupon}} for the actual coupon. Either 'message' or 'templateId' is required. templateId String template message. Either 'message' or 'templateId' is required. Returns: Promise object Type Object <static> sendPushNotification(playerId, message, templateId) Send push notification to player. Parameters: Name Type Description playerId String player id. message String push notification message. Either 'message' or 'templateId' is required. templateId String template id for message. Either 'message' or 'templateId' is required. Returns: Promise object Type Object <static> sendPushNotificationCoupon(playerId, refId, message, templateId) Send coupon to player via push notification. Parameters: Name Type Description playerId String player id refId String reference transaction id for redemption message String SMS message. It can use variable {{coupon}} for the actual code. Either 'message' or 'templateId' is required. templateId String template message. Either 'message' or 'templateId' is required. Returns: Promise object Type Object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:05 pm using the DocStrap template. "},"Playbasis.const.html":{"id":"Playbasis.const.html","title":"Namespace: const","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: const Playbasis. const Playbasis Constants Members <static> errorCode :Object Error code. Type: Object Properties: Name Type Description internetConnectionIssue Number Suspect to be a problem about Internet connection. User might not be able to connect to the Internet. × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.contentApi.html":{"id":"Playbasis.contentApi.html","title":"Namespace: contentApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: contentApi Playbasis. contentApi Playbasis Content Organize API Methods <static> countContent(options) Count content(s) by specified filter fields. Parameters: Name Type Description options Object (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 name String name of category Returns: Promise object Type Object <static> createContent(title, summary, detail, options) Create content. Parameters: Name Type Description title String title of content summary String summary of content detail String detail of content options Object (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 id String category id Returns: Promise object Type Object <static> deleteContent(nodeId) Delete existing content Parameters: Name Type Description nodeId String 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 nodeId String node id of content playerId String player id to like content options Object (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 nodeId String node id of content playerId String player id to like content feedback String feedback to give to content options Object (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 nodeId String node id of content playerId String player id to like content options Object (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 options Object (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 records limit: 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 options Object (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 id String category id name String category name to update Returns: Promise object Type Object <static> updateContent(nodeId, updates) Update content by content id Parameters: Name Type Description nodeId String node id of content updates Object 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 × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.engineApi.html":{"id":"Playbasis.engineApi.html","title":"Namespace: engineApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util 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 × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.goodsApi.html":{"id":"Playbasis.goodsApi.html","title":"Namespace: goodsApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: goodsApi Playbasis. goodsApi Playbasis Goods API Methods <static> goodsGroupAvailable(playerId, group, options) Find number of available Goods given group. Parameters: Name Type Description playerId String player id group String goods group options Object (optional) options as object. It can include { amount: Number = amount of the goods to redeem } Returns: Promise object Type Object <static> goodsInfo(goodsId, options) Returns information about the goods with the specified id. Parameters: Name Type Description goodsId String goods id options Object (optional) options as object. It can include { player_id: String } Returns: Promise object Type Object <static> goodsListInfo(options) Returns information about all available goods for the current site. Parameters: Name Type Description options Object (optional) options as object. It can include { player_id: String = player id active_filter: Boolean = filter only active goods items based on today. It will include only item that has been started but not yet expired, but not include items that has not yet started or have a start date in the future. It can be set to true | false. name: String = name or group name of goods to search date_start: String = date start in the format YYYY-MM-DD (i.e. 1982-09-29) to filter goods whose valid start date is in specified range date_end: String = date expire in the format YYYY-MM-DD (i.e. 1982-09-29) to filter goods whose valid end date is in specified range offset: String = paging offset. Default is 0. limit: Number = paging limit. Default is unlimited. tags: String = delimit by comma custom_param: String = specific custom param(s) to filter for results. It needs to be in format key or key|operator|value in which operator can be \"<\", \"<=\", \">\", \">=\", \"=\", \"!=\". Such key needs to be set prior on dashboard first. not_custom_param: String = specific custom param(s) to filter for results. It needs to be in format key or key|operator|value in which operator can be \"<\", \"<=\", \">\", \">=\", \"=\", \"!=\". Such key needs to be set prior on dashboard first. }. Returns: Promise object Type Object <static> goodsListInfoWithSelectedFields(options) Return information about all available goods for the current site. Parameters: Name Type Description options Object (optional) options as object. It can include { player_id: String = player id selected_field: String = fields that will be included result payload, delimited with comma and with no space i.e. field1,field2,field3. active_filter: Boolean = filter only active goods items based on today. It will include only item that has been started but not yet expired, but not include items that has not yet started or have a start date in the future. It can be set to true | false. date_start: String = date start in the format YYYY-MM-DD (i.e. 1982-09-29) to filter goods whose valid start date is in specified range date_end: String = date expire in the format YYYY-MM-DD (i.e. 1982-09-29) to filter goods whose valid end date is in specified range offset: String = paging offset. Default is 0. limit: Number = paging limit. Default is unlimited. tags: String = delimit by comma custom_param: String = specific custom param(s) to filter for results. It needs to be in format key or key|operator|value in which operator can be \"<\", \"<=\", \">\", \">=\", \"=\", \"!=\". Such key needs to be set prior on dashboard first. not_custom_param: String = specific custom param(s) to filter for results. It needs to be in format key or key|operator|value in which operator can be \"<\", \"<=\", \">\", \">=\", \"=\", \"!=\". Such key needs to be set prior on dashboard first. } Returns: Promise object Type Object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.helpers.html":{"id":"Playbasis.helpers.html","title":"Namespace: helpers","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: helpers Playbasis. helpers Playbasis Helpers Methods <static> appendAndJoinIfNotNullAsUrlParam(param) Join variable url param together as query string, then prefix it with \"&\" if there's at least one non-null key-value pair. Parameters: Name Type Argument Description param param <repeatable> url param as part of url Returns: query string Type string <static> appendAndJoinIfNotNullAsUrlParam2(keys, defaultValues, inputObj) Join variable url param together as query string, then prefix it with \"&\" if there's at least one non-null key-value pair. Parameters: Name Type Description keys Array Array containing all keys string defaultValues Array Array containing all default values string inputObj Object Input optional object parameter, inside there're key-value pairs according to key and values of final query string Returns: query string Type String <static> combinedObjects(objA, objB) Combine two objects together but skip key-value pair whose either key or value is null. If both of objects are null, then return empty object. If object B has same keys as in object A, object A's values will be replaced by values of object B. Parameters: Name Type Description objA Object object A to combine objB Object object B to combine Returns: Combined object A and B but skipped key-value pair whose either key or value is null Type Object <static> createApiUrl(method, param) Create api url for used with Playbasis's API modules. If you use this, make sure you know what you're doing. Parameters: Name Type Argument Description method string method url for target API param param <repeatable> url param as part of url Returns: url ready to be used to make a qurey for Playbasis's API modules Type string <static> createObjectFromTarget(obj, keysLimit) Create object with keys and values from specified object. If 'keysLimit' is specified then it will only copy for those matching keys only, and ignore the less. It will ignore and skip key-value pair whose either key or value is null. It specified object is null, then it will create an empty object. Parameters: Name Type Description obj Object target object to get keys and values from in order to create a new object keysLimit Array (optional) keys as array to limit the copying process from target object Returns: new object created with non-null keys and values from specified object Type Object <static> joinIfNotNullAsUrlParam(param) Join variable url param together as query string. Parameters: Name Type Argument Description param param <repeatable> url param as part of url Returns: query string Type string <static> joinParams(paramKvp) Join each key of object into querystring and return it. It will iterate for all keys of its object, and process each pair of KVP making into final querystring. Parameters: Name Type Description paramKvp object options object Returns: query string Type string × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.http.html":{"id":"Playbasis.http.html","title":"Namespace: http","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: http Playbasis. http Playbasis Http Module Methods <static> getJsonAsync(url) Make a GET request Parameters: Name Type Description url string target url to send request to Returns: Promise object Type object <static> postJsonAsync(url, postDataKvp) Make a POST request Parameters: Name Type Description url String url target to send request to postDataKvp Object Post data as object key-value pair. Returns: Promise object Type object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.livefeedApi.html":{"id":"Playbasis.livefeedApi.html","title":"Namespace: livefeedApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: livefeedApi Playbasis. livefeedApi Playbasis Livefeed API Methods <static> commentActivity(activityId, playerId, message) Comment acvitity Parameters: Name Type Description activityId String activity id playerId String player id message String message Returns: Promise object Type Object <static> detailActivity(activityId) Get detail activity. Parameters: Name Type Description activityId String activity id Returns: Promise object Type Object <static> likeActivity(activityId, playerId) Like activity Parameters: Name Type Description activityId String activity id playerId String player id Returns: Promise object Type Object <static> recentActivities(options) Return recent activities. Parameters: Name Type Description options Object (optional) options as object. It can include { player_id: String = required when 'mode'='player', offset: Number = index of record to start, limit: Number = amount of records returned, last_read_activity_id: String = last activity id that you have read, mode: String = \"all\" | \"player\", event_type: String = event type i.e. \"reward\", \"redeem\", \"action\", \"level\" } Returns: Promise object Type Object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.merchantApi.html":{"id":"Playbasis.merchantApi.html","title":"Namespace: merchantApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: merchantApi Playbasis. merchantApi Playbasis Merchant API Methods <static> availableBranchForGoodsGroup(goodsGroup) Return list of available branch of goods group. Parameters: Name Type Description goodsGroup String name of goods group Returns: Promise object Type Object <static> redeemCoupon(goodsGroup, couponCode, options) Merchant redeems couple from player. Parameters: Name Type Description goodsGroup String goods group name. couponCode String coupon code of goods to redeem options Object (optional) options as object. It can include. { pin_code: String = merchant PIN code generated from admin dashboard player_id: String = player id } Returns: Promise object Type Object <static> redeemGoods(goodsName, playerId, options) Merchant redeems normal goods from player Parameters: Name Type Description goodsName String goods name playerId String player id options Object options as object. It can include amount: Number = amount of goods to redeem from player (default = 1) Returns: Promise object Type Object <static> verifyCoupon(goodsGroup, couponCode, options) Verify coupon code available to be redeemed. Parameters: Name Type Description goodsGroup String goods group name couponCode String coupon code of goods to verify options Object (optional) options as object. It can include { pin_code: String = merchant PIN code generated from admin dashboard player_id: String = player id } Returns: Promise object Type Object × Search results Close Documentation generated by JSDoc 3.6.2 on August 23rd 2019, 1:59:06 pm using the DocStrap template. "},"Playbasis.playerApi.html":{"id":"Playbasis.playerApi.html","title":"Namespace: playerApi","body":" Documentation Namespaces PlaybasisPlaybasis.authApiPlaybasis.badgeApiPlaybasis.barCodePlaybasis.builderPlaybasis.communicationApiPlaybasis.constPlaybasis.contentApiPlaybasis.engineApiPlaybasis.goodsApiPlaybasis.helpersPlaybasis.httpPlaybasis.livefeedApiPlaybasis.merchantApiPlaybasis.playerApiPlaybasis.pointApiPlaybasis.qrCodePlaybasis.questApiPlaybasis.quizApiPlaybasis.redeemApiPlaybasis.serviceApiPlaybasis.storeOrganizeApiPlaybasis.util Namespace: playerApi Playbasis. playerApi Playbasis Player API Methods <static> actionCount(playerId, actionName) Returns the number of times that a player has performed the specified action. Parameters: Name Type Description playerId String player id actionName String name of the action to query Returns: Promise Object Type Object <static> actionTime(playerId, actionName) Return the last time that player has performed the specified action. Parameters: Name Type Description playerId String player id actionName String name of action to query Returns: Promise Object Type Object <static> allBadges(playerId, options) Return information about all the badges of the client as well as the amount that a player may earn. Parameters: Name Type Description playerId String player id options Object (optional) options as object. It can include. { tags: String = specific tags to find, each tag delimited by comma i.e. foo,bar } Returns: Promise Object Type Object <static> allQuestsOfPlayer(playerId) Return list of all available quests of the client as well as the status of the player if joined. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> badge(playerId, options) Return information about all the badges that a player has earned. Parameters: Name Type Description playerId String player id options Object (optional) options as object. It can include { tags: String = specific tags to find, each tag delimited by comma i.e. foo,bar } Returns: Promise Object Type Object <static> deductBadge(playerId, badge, amount, options) Deduct a badge from a given player. Parameters: Name Type Description playerId String player id badge String name of badge to deduct amount Number amount to deduct options Object (optional) options as Object. It can include { force: Number = 0 for not force if player has not enough badge to deduct | 1 = force to do the deduct (and player's badge becomes zero) } Returns: Promise Object Type Object <static> deductReward(playerId, reward, amount, options) Deduct a reward from player Parameters: Name Type Description playerId String player id reward String reward name to deduct from player amount Number amount of reward to deduct options Object (optional) options as Object. It can include { force: Number = 0 for not force if player has not enough reward to deduct | 1 = force to do the deduct (and player's reward becomes zero) }. Returns: Promise Object Type Object <static> delete(playerId) Permanently delete player from Playbasis database. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> favoriteGoods(playerId, goodsId, status) Set specific goods in player's inventory as favorite Parameters: Name Type Description playerId String player id goodsId String goods id to set favorite status status Boolean status to set. It can be either true or false Returns: Promise object Type Object <static> findPlayerBySession(sessionId) Find a player by given session id. Parameters: Name Type Description sessionId String session id Returns: Promise Object Type Object <static> giveGift(sentPlayerId, receivedPlayerId, giftId, type, amount) Give gift item from player to player. Parameters: Name Type Description sentPlayerId String player id that send the gift receivedPlayerId String player id that received the gift giftId String gift id can be badge id, goods id , custom point id type String type of gift, the value can be \"badge\" | \"custom_point\" | \"goods\" amount Number amount of gift to be sent to received player Returns: Promise Object Type Object <static> goods(playerId, options) Returns information about all the goods list that a player has redeem. Parameters: Name Type Description playerId String player id options Object (optional) options as Object. It can include { tags: String = tag to query separated by comma, status: String = \"all\" | \"active\" | \"expired\" | \"used\". Default is \"active\". }. <static> goodsCount(playerId, options) Returns information about number of goods that player has Parameters: Name Type Description playerId String player id options Object (optional) options as Object. It can include { tags: String = goods tag to query separated by comma, status: String = \"all\" | \"active\" | \"expired\" | \"used\". Default is \"active\". }. Returns: Promise object Type Object <static> lastAction(playerId) Return the time and action that a player last performed. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> level(level) Return detail of level Parameters: Name Type Description level Number numbe of level Returns: Promise Object Type Object <static> levels() Return all detail of level. Returns: Promise Object Type Object <static> listActivePlayerSessions(playerId) List active sessions of a player in Playbasis system. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> listCustomFieldsOfPlayer(playerId) Get custom fields information about a player. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> listPlayer(playerIdArray) Get basic information of players Parameters: Name Type Description playerIdArray String array of player id String Returns: Promise Object Type Object <static> login(playerId) Tell Playbasis system that a player has logged in. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> logout(playerId) Tell Playbasis system that a player has logged out. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> performOTPVerification(playerId, OTPcode) Perform OTP verification from code that has sent to player SMS. Parameters: Name Type Description playerId Stirng player id OTPcode String OTP code as sent to player Returns: Promise Object Type Object <static> playerDetailedInfo(playerId) Get detailed public and private information about player, including points and badges. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> playerDetailedPublicInfo(playerId) Get detailed public information about player, including points and badges. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> playerInfo(playerId) Get public and private information about a player. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> playerPublicInfo(playerId) Get public information about player. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> playerReferralCode(playerId) Return generated referral code of player. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> point(playerId, pointName) Returns how much of specified the point-based reward a player currently has. Parameters: Name Type Description playerId String player id pointName String name of point-based reward to query Returns: Promise Object Type Object <static> pointHistory(playerId, options) Returns history points of player Parameters: Name Type Description playerId String player id options Object (optional) options as Object. It can include { point_name: String = \"point\" | \"exp\" | ..., offset: Number = offset of returned records, limit: Number = number of returned records to return, order: String = \"desc\" | \"asc\" } Returns: Promise Object Type Object <static> points(playerId) Return information about all point-based rewards that a player currently has. Parameters: Name Type Description playerId String player id Returns: Promise Object Type Object <static> questListOfPlayer(playerId, options) Return list of quests that player has joined. Parameters: Name Type Description playerId String player id options Object (optional) options as Object. It can include { tags: String = tag to query separated by comma }. <static> questOfPlayer(playerId, questId) Return information about the specified quest that player has joined. Parameters: Name Type Description playerId String player id questId String quest id that playered has joined, to get information from <static> questRewardHistory(playerId, options) Return quest reward history of player. Parameters: Name Type Description playerId String player id options Object (optional) options as Object. It can include { offset: Number, limit: Number } Returns: Promise Object Type Object <static> rank(rankBy, limit, options) Return the list of players sorted by the specified point type. Parameters: Name Type Description rankBy String point-based name to rank by (\"exp\" | \"point\", etc) limit Number amount of items to return options Object (optional) options as Object. It can include { mode: String = \"all-time\" | \"weekly\" | \"monthly\" }. Returns: Promise Object Type Object <static> ranks(limit, options) Return list of players sorted by each point type. Parameters: Name Type Description limit Number limit number of players returned in the list options Object (optional) option as Object. It can include { mode: String = \"all-time\" | \"weekly\" | \"monthly\" }. <static> referral(playerId, referralCode, options) Referral player Parameters: Name Type Description playerId String player id referralCode String referral code