-1

Yahoo Mail API sample code not working ??

I have just registered an application with full access to Yahoo!Mail. I downloaded the sample code, copied by consumer key and secrets from the "My Projects" page and tried to follow the example. The system throws an exception because the call to get_token fails.

C:\phpstuff\yahoomail\phpsample>php -c c:\php5 ListFolders.php json <my key from MyProjects> <my secret from MyProjects>
PHP Fatal error: Uncaught exception 'Exception' in C:\phpstuff\yahoomail\phpsam
ple\ListFolders.php:50
Stack trace:
#0 {main}
thrown in C:\phpstuff\yahoomail\phpsample\ListFolders.php on line 50

Fatal error: Uncaught exception 'Exception' in C:\phpstuff\yahoomail\phpsample\L
istFolders.php:50
Stack trace:
#0 {main}
thrown in C:\phpstuff\yahoomail\phpsample\ListFolders.php on line 50


Any idea why this would fail ? I just plainly followed the steps in the example ?

by
2 Replies
  • Hi

    I guess its because of the -c path option which you have specified which I guess is invalidating the command line args. Try without giving it (assuming you have php5.2 and the necessary curl version - check the prereqs) . Let me know if it works fine. Thanks

    --R


    QUOTE (Jerome P @ Jul 11 2010, 06:56 PM) <{POST_SNAPBACK}>
    I have just registered an application with full access to Yahoo!Mail. I downloaded the sample code, copied by consumer key and secrets from the "My Projects" page and tried to follow the example. The system throws an exception because the call to get_token fails.

    C:\phpstuff\yahoomail\phpsample>php -c c:\php5 ListFolders.php json <my key from MyProjects> <my secret from MyProjects>
    PHP Fatal error: Uncaught exception 'Exception' in C:\phpstuff\yahoomail\phpsam
    ple\ListFolders.php:50
    Stack trace:
    #0 {main}
    thrown in C:\phpstuff\yahoomail\phpsample\ListFolders.php on line 50

    Fatal error: Uncaught exception 'Exception' in C:\phpstuff\yahoomail\phpsample\L
    istFolders.php:50
    Stack trace:
    #0 {main}
    thrown in C:\phpstuff\yahoomail\phpsample\ListFolders.php on line 50


    Any idea why this would fail ? I just plainly followed the steps in the example ?
    0
  • The -c path option tells PHP where to find the php.ini. That is not the issue.

    I found out what happened. For some reason on my install curl fails to access https URLs. I replaced it with flle_get_contents($url) and it works now.
    I'll use this as a workaround for now. Still would like to know what's happening to curl

    Thanks anyway


    PHP is 5.2.6, curl is enabled with libcurl/7.16.0

    QUOTE (Ram @ Jul 11 2010, 10:23 PM) <{POST_SNAPBACK}>
    Hi

    I guess its because of the -c path option which you have specified which I guess is invalidating the command line args. Try without giving it (assuming you have php5.2 and the necessary curl version - check the prereqs) . Let me know if it works fine. Thanks

    --R
    0

Recent Posts

in Yahoo! Mail Web Services API