Page 1 of 1

API command sample for php?

PostPosted: Mon Dec 15, 2014 8:39 am
by kingprado
Hiiiiiiiiiiiii

Well, we got a problem with api command AccountsIncBalance , can I have a sample php code to how to use it?or a good reference for it

Regards

Re: API command sample for php?

PostPosted: Mon Dec 15, 2014 10:20 am
by Kent Briggs
kingprado wrote:Well, we got a problem with api command AccountsIncBalance , can I have a sample php code to how to use it?or a good reference for it


The API docs in the help file show:

AccountsIncBalance - increments the account balance of a player. Use a Player parameter to specify the player's name and an Amount parameter to specify the number of chips to add to the account. A "Balance" parameter is returned in the result indicating the player's new chip balance. This command is safe to use even while the player is logged in and playing.

What problem are you having?

Re: API command sample for php?

PostPosted: Mon Dec 15, 2014 12:26 pm
by kingprado
Kent Briggs wrote:
kingprado wrote:Well, we got a problem with api command AccountsIncBalance , can I have a sample php code to how to use it?or a good reference for it


The API docs in the help file show:

AccountsIncBalance - increments the account balance of a player. Use a Player parameter to specify the player's name and an Amount parameter to specify the number of chips to add to the account. A "Balance" parameter is returned in the result indicating the player's new chip balance. This command is safe to use even while the player is logged in and playing.

What problem are you having?



Actually I want to wrote a code for increasing the account amount but If I had a sample from one of the php samples for such api commands ( which it is correct and it's working , I could use all of commands easily....)

Thanks

Re: API command sample for php?

PostPosted: Mon Dec 15, 2014 12:45 pm
by Kent Briggs
Code: Select all
<?php
  include "API.php";
  $player = "test";
  $amount = 10;
  $params = array("Command" => "AccountsIncBalance", "Player" => $player, "Amount" => $amount);
  $api = Poker_API($params);
  if ($api -> Result == "Error") die("Error: " . $api -> Error);
  echo $amount . " chips added to balance for " . $player;
?>

Re: API command sample for php?

PostPosted: Wed Dec 17, 2014 10:37 am
by kingprado
Thank you for your ur kindness

May I have another sample for AccountsEdit command? I'm confused...

Re: API command sample for php?

PostPosted: Wed Dec 17, 2014 10:58 am
by Kent Briggs
Have you ever written PHP code (or any code before)?

Code: Select all
    <?php
      include "API.php";
      $player = "test";
      $location = "Houston";
      $params = array("Command" => "AccountsEdit", "Player" => $player, "Location" => $location);
      $api = Poker_API($params);
      if ($api -> Result == "Error") die("Error: " . $api -> Error);
      echo "Location for " . $player . " changed to " . $location;
    ?>

Re: API command sample for php?

PostPosted: Sat Dec 20, 2014 3:59 pm
by kingprado
Hi again,

May I have another example for Valcode command to verify account? And I want to use this code in my login page which I made it,May I have some guidance?I mean I want to make another form in my login page to be used for only Valcode to verify user's emails...

Best wishes

Re: API command sample for php?

PostPosted: Sat Dec 20, 2014 4:34 pm
by Kent Briggs
kingprado wrote:May I have another example for Valcode command to verify account?


Same as above except replace "Location" with "ValCode" or whatever property you want to edit. All the property names are documented in the API section of the help file.