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