API command sample for php?

For general discussion of the Poker Mavens software
Post Reply
kingprado
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

API command sample for php?

Post 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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Post 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?
kingprado
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Post 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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Post 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;
?>
kingprado
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Post by kingprado »

Thank you for your ur kindness

May I have another sample for AccountsEdit command? I'm confused...
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Post 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;
    ?>
kingprado
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

Re: API command sample for php?

Post 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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API command sample for php?

Post 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.
Post Reply