Page 1 of 1

TournamentsResults API error

PostPosted: Thu Jun 04, 2015 10:51 am
by bruno
Hi,

I'm having a problem with TournamentsResults calls when the tournament has a tie. Check examples bellow:

Here's a the txt file saved at the server:

Code: Select all
Tournament=Test 1
Number=1753
BuyIn=18+2
PrizeBonus=0
MultiplyBonus=No
Entrants=10
Late=0
Removed=0
Rebuys=12
AddOns=5
RebuyCost=18+2
NetBonus=0
StopOnChop=No
Start=2015-05-28 21:00:10
Place10=Johngot (0) Rebuys:2 AddOn:Yes
Place9=rholuu (0) Rebuys:2 AddOn:No
Place8=badesc (0) Rebuys:0 AddOn:No
Place7=wokli2 (0) Rebuys:2 AddOn:No
Place6=jdaupor (0) Rebuys:3 AddOn:No
Place5=maviat (0) Rebuys:1 AddOn:Yes
Place4=rsp60br (0) Rebuys:0 AddOn:No
Place1=frscom74 (162) Rebuys:1 AddOn:Yes
Place1=gertring (162) Rebuys:0 AddOn:Yes
Place1=gollart (162) Rebuys:1 AddOn:Yes
Stop=2015-05-29 11:26:35 (Abort)


And here's what the API returns:

Code: Select all
[Result] => Ok
    [Tournament] => Test 1
    [Number] => 1753
    [BuyIn] => 18+2
    [PrizeBonus] => 0
    [MultiplyBonus] => No
    [Entrants] => 10
    [Late] => 0
    [Removed] => 0
    [Rebuys] => 12
    [AddOns] => 5
    [RebuyCost] => 18+2
    [NetBonus] => 0
    [StopOnChop] => No
    [Start] => 2015-05-28 21:00:10
    [Place10] => Johngot (0) Rebuys:2 AddOn:Yes
    [Place9] => rholuu (0) Rebuys:2 AddOn:No
    [Place8] => badesc (0) Rebuys:0 AddOn:No
    [Place7] => wokli2 (0) Rebuys:2 AddOn:No
    [Place6] => jdaupor (0) Rebuys:3 AddOn:No
    [Place5] => maviat (0) Rebuys:1 AddOn:Yes
    [Place4] => rsp60br (0) Rebuys:0 AddOn:No
    [Place1] => gollart (162) Rebuys:1 AddOn:Yes
    [Stop] => 2015-05-29 11:26:35 (Abort)


As you can see there is 3 players tied at first place on the txt file, but the API only returns the last one. How can I get the other 2 players information?

Best,
Bruno.

Re: TournamentsResults API error

PostPosted: Thu Jun 04, 2015 12:40 pm
by Kent Briggs
When using the legacy API method, there are three parameters for the Poker_API function:

function Poker_API($url, $params, $assoc)

Set the $assoc parameter to false so that the result is not returned in an associative array. Otherwise, parameters with the same key name will get overwritten. A single tourney results file may contain results from multiple tournaments if they all ran in that day so you will get array elements overwriting elements from other tournaments too. Also, I highly recommend that convert your API calls to the newer JSON method so that the result is returned in a single object. In the case of TournamentsResults, all lines will be returned in a single "Data" array inside that object.