Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

Create player using the data passed in the constructor.


Please do not use real player passwords. Because if the player changes his password, you will not be able to log him in via the API. Send a constant password for all players, or create a password by hashing some constant user details (like username) and send that instead.

Username must be max 12 characters long! If your player usernames exceed that limit, then please send your player's ID as username.

REST REQUEST
Array
(
	[api_password] => xapitest
	[api_login] => xapitest
	[method] => createPlayer
	[user_id] => 123
	[user_username] => domendomen2
	[user_password] => 687ee8d988b2411bfc6983c4fca2f6c622819ac8
	[currency] => EUR
)
REST RESPONSE
ON ERROR
{"error":1,"message":"Player already exists"}
ON SUCCESS
{"error":0,"response":
{"id":"41457","username":"xxdomendomen2","balance":"20.00","currencycode":"EUR","created":"2013-02-15
14:57:47","agent_balance":null}}
Source Code
public function createPlayer(){
	if($this->playerExists() === FALSE){
    	return $this->client->createPlayer($this->user);
	}else{
		return "player already exists";
	}
}
  • No labels