Running the Code

  1. Download and unzip the file on your local drive.

    You should see the following six files:

    HowToRun.txt, ListFolders.php, GetUserData.php, ListFoldersUrl.php,, and OAuth.php.

  2. If you have specified the callback_url parameter when getting the App keys, then please specify the same for oauth_callback in all occurrences of the code samples (ListFolders.php, ListFoldersUrl.php, GetUserData.php) or else just leave it as "oob".
  3. In the unzipped directory, run the following command, where <access_protocol> can be either json or soap:

    $php ListFolders.php <access_protocol> <consumer_key> <secret_key>

  4. The returned response shows your Yahoo! Mail folders and information about each folder as seen below:

  5. Great, you can now use the Mail Web Service. If you are having problems, be sure that you have met the prerequisites. If you met the prerequisites and are still encountering problems, please post your questions to the Yahoo! Mail Developer Community.


The samples have been tested in PHP 5.2.11 with curl 7.16.3.

Certain versions of PHP remove the OAuth headers when making SOAP calls. Please refer the bug id 50976. In such cases specify the SOAP request as URL parameters. For example ListFoldersUrl.php

Table of Contents