Moving From API-6 to API-NG (PHP)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RicHep365
    Junior Member
    • Apr 2012
    • 5

    #1

    Moving From API-6 to API-NG (PHP)

    Yes I have left this rather late and now pretty stressed trying to work it out.

    I coded our system in PHP and it has happily been working for the past 2 years without much further intervention but now I need to implement the new API before it gets switched off.

    The old API used to return an Object which you could traverse down to extract the relevant info (like traversing an array);

    Can anyone explain to me how the new modules return the info for interrogation in PHP?

    An example of fetching horse racing markets and then runners would be very handy and I would be forever in your debt

    Kind Regards

    OLI

    EXAMPLE:

    Previously to get the prices of a market you would call : $prices = SelectionPrices($session, $BF_MarketID);

    That would return an array which you could then traverse down to get the info for that market

    Code:
    foreach($prices as $marketinfo)
    {									
         if (!empty($marketinfo))
         {																									
    	foreach($marketinfo["runnerInfo"] as $runnerInfo)
    	{					
    							
    		$selectionId = $runnerInfo["selectionId"];	
    							
    		$lastPriceMatched = $runnerInfo["lastPriceMatched"];
    									
    		foreach($runnerInfo["priceToBack"] as $back_info)
    		{					
    		        $back_price_1 = $back_info["price"];
    			$liquidity = $back_info["amount"];
    		}		
    	}
    				
    }
    So the question is......what does API-NG return in PHP and how is it processed?
    Last edited by RicHep365; 01-10-2014, 09:47 AM.
Working...
X