Playbasis Communication API
Methods
-
<static> deregisterDevice(playerId, deviceToken)
-
Deregister device for push notification. Either 'playerId' or 'deviceToken' is required.
Parameters:
Name Type Description playerIdString player id. Either 'playerId' or 'deviceToken' is required.
deviceTokenString 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 templateIdString email template id
optionsObject (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 templateIdString push notification template id
optionsObject (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 templateIdString template id
optionsObject (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 playerIdString player id
optionsObject (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 playerIdString player id
optionsObject (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 playerIdString player id
optionsObject (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 playerIdString player id
deviceTokenString device token
deviceDescriptionString device model description
deviceNameString device model name
osTypeString 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 playerIdString player id
subjectString email subject
messageString email message (either message or templateId is required)
templateIdString 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 playerIdString player id
refIdString reference transaction id for redeption
subjectString email subject
messageString email message, you can use {{coupon}} for the actual coupon. Either 'message' or 'templateId' is required.
templateIdString 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 playerIdString player id.
messageString push notification message. Either 'message' or 'templateId' is required.
templateIdString 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 playerIdString player id
refIdString reference transaction id for redemption
messageString SMS message. It can use variable {{coupon}} for the actual code. Either 'message' or 'templateId' is required.
templateIdString template message. Either 'message' or 'templateId' is required.
Returns:
Promise object
- Type
- Object