Commit 2067c6d8 authored by zeynel's avatar zeynel

Add new player endpoints

parent 907fb355
......@@ -308,4 +308,49 @@ Client.prototype.csvExport = function (body, callback) {
return basicRequest(csvUri, this.app.appAuthKey, 'POST', body, callback);
};
/**
*
* @param playerId Id of the player
* @param body
* @param callback
* @returns {*}
*/
Client.prototype.newSession = function (playerId, body, callback) {
if (!this.app) {
throw 'You must define an "app" object.'
}
var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_session';
return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback);
};
/**
*
* @param playerId
* @param body
* @param callback
* @returns {*}
*/
Client.prototype.newPurchase = function (playerId, body, callback) {
if (!this.app) {
throw 'You must define an "app" object.'
}
var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_purchase';
return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback);
};
/**
*
* @param playerId
* @param body
* @param callback
* @returns {*}
*/
Client.prototype.incrementSessionLength = function (playerId, body, callback) {
if (!this.app) {
throw 'You must define an "app" object.'
}
var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_focus';
return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback);
};
module.exports = Client;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment