0

Need help to read fantasy sports API by PHP

Hello,
I am trying to read data through fantasy sports API by using PHP but getting Authorization error. can anyone help me to resolve the problem ASAP?
I have given 2 code snippet by which i have tried:

Ex - 1
-----------------------------------------------------
$request= "http://fantasysports.yahooapis.com/fantasy/v2/game/223";
$response = file_get_contents($request);
$obj = simplexml_load_string($response);

Ex - 2
-----------------------------------------------------
$session = curl_init($request);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);

Please help..

by
4 Replies
  • Can anyone help me by giving sample PHP code to read data through fantasy sports API?
    0
  • QUOTE (Morshed @ Jun 29 2010, 12:34 PM) <{POST_SNAPBACK}>
    Can anyone help me by giving sample PHP code to read data through fantasy sports API?


    You need to authorize the user before accessing the API. The work has only just begun for you my friend. heh.

    This is the guide I followed for PHP, to get my users authenticated properly.
    0
  • QUOTE (brant @ Jun 29 2010, 02:50 PM) <{POST_SNAPBACK}>
    You need to authorize the user before accessing the API. The work has only just begun for you my friend. heh.

    This is the guide I followed for PHP, to get my users authenticated properly.


    Thank you very much Brant. I did this by following the article.
    0
  • QUOTE (Morshed @ Jun 30 2010, 02:21 AM) <{POST_SNAPBACK}>
    Thank you very much Brant. I did this by following the article.

    Morshed, after following that article, have you had any luck with the Fantasy Sports API?
    0

Recent Posts

in Fantasy Sports API