In order to use the Yahoo! Mail APIs, you first need to access your user’s data, with their permission, using Brower-Based Authentication (BBA). This guide assumes you already know how to get started with BBA. See the BBAuth section on Yahoo! Developer Network for more information.Currently, the Yahoo! Mail Web Service APIs cannot access Yahoo! Business Mail or Yahoo! Japan Mail accounts.Before you begin, you must follow the steps on the BBAuth quick start, and load the web service session ID (WSSID) and the credentials for the current user.In addition, you will need the application ID issued to you when you signed up for access to the Yahoo! Mail Web Service.Use WSDL to construct your SOAP client. Even though a service endpoint URL is indicated in the WSDL, you must provide a location URL to your SOAP toolkit. This is necessary to transmit the application ID and the WSSID. In addition, you must set the cookie header containing the cookie that was returned with the WSSID when you credentialed the user in the previous step.$location = "http://mail.yahooapis.com/ws/mail/v1.1/soap?appid=" . urlencode($appid) . "&WSSID=" . urlencode($wssid);The Yahoo! Mail Web Service limits the functionality available to free accounts. Premium accounts have no such limits. First call the GetUserData method to get the user’s account type from the web service.
Calls to other APIs will return an error. To upgrade to premium, go to mailplus.mail.yahoo.com. For information on how to receive a commission for upgrading users to a premium Yahoo! Mail Plus account see the Yahoo! Mail Web Service page on the Yahoo! Developer Network.Once you have determined the user’s level of service, you can make additional calls to Yahoo! Mail. For example, call the ListFolders method to get a list of folders that the user has in their mail account.Some methods require parameters passed as a single object parameter. For example, the following code creates and passes to the ListMessages method a request object containing which folder to fetch messages from, where to start, and the number of messages to fetch.The following links will allow you to link into a user’s mailbox from another application. They will recognize whether the user is using beta mail or classic mail.The Yahoo! Mail Web Service has a call batching mechanism. Use the BatchExcecute method to excecute up to five methods in a single call. Batch calls can be chained, so that each call is dependent on the previous call’s successful execution. In addition, with the parameter field, each call can reference data specified by the source and destination paths.Each batch call can have a dependency on the successful execution of other batch calls. To do this, add an id attribute to each batch call that must execute before any following calls. To subsequent batch calls, add a dependency tag that specifies the id of any calls that must successfully execute before this one. Calls with one or more dependencies will not execute unless all call(s) listed in its dependency tag have excuted.For example, the following SOAP request calls ListMessages and GetMessages. GetMessages is dependent on ListMessages and will not execute until it successfully executes.You can associate data with a batch call using the parameter tag which can contain a "source" and a "destination" path. The source path specifies the location, starting with a call ID, of a piece of data. The destination path specifies the location, starting with the call ID of the current call, of a placeholder. Yahoo! Mail will look up the source path and place that piece of data into the current call request at the location given by the destination path.All endpoints accept only POST requests. The requests themselves are serialized as XML, JSON or PHP and comprise the entire POST body. The request headers should indicate what content type the request is in. All endpoints accept and return UTF-8 data only.SOAP can be reached by sending all calls to http://mail.yahooapis.com/ws/mail/v1.1/soap. Additionally, the WSDL for the service is available at http://mail.yahooapis.com/ws/mail/v1.1/wsdl.<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><messageInfo mid="1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM" toEmail="mc_ymailsearch_test@yahoo.com"subject="Vote for your favorite spots in San Francisco, you could win a 2006 Mazda!"mimeType="multipart/alternative" externalPopServer="" receivedDate="1127551268" size="18714"><flags isReplied="0" isFlagged="0" isRead="0" isDraft="0" isForwarded="0" isHam="0" isSpam="0"</messageInfo>The JSON-RPC endpoint implements the JSON-RPC spec on top of the web service. Requests are serialized JavaScript following a specific data format. Each serialized JavaScript object contains the following properties:
● id (optional): the ID of the request, allows asynchronous clients to match a response back up with the original request.The service responds with serialized JavaScript as well. Once again, the JavaScript object follows a specific data format:
● "subject":"Vote for your favorite spots in San Francisco, you could win a 2006 Mazda!",