ymailsdk

60
Yahoo! Mail Web Service User Guide and API Reference

Upload: vinay-kr-sharma

Post on 30-Jan-2016

220 views

Category:

Documents


1 download

DESCRIPTION

Yahoo! Mail Web Service User Guide and API Reference Abstract Copyright © 2008, Yahoo! Inc. 2. You may not use the Yahoo! Mail Web Service API to mine or scrape user data from the user's Yahoo! account. 1. You must use the Browser Based Authentication API to enable access to the user's Yahoo! account through your Application. 3. You may not use the Yahoo! Mail Web Service API to recreate a mimicked version of Yahoo! Mail on your site. iii iv v vi

TRANSCRIPT

Page 1: yMailSDK

Yahoo! Mail Web Service User Guide andAPI Reference

Page 2: yMailSDK

Yahoo! Mail Web Service User Guide and API ReferenceCopyright © 2008, Yahoo! Inc.

Abstract

The Yahoo! Mail Web Service gives developers access to APIs for Yahoo! Mail. With the Yahoo! Mail Web ServiceAPIs, you can build Web applications to perform tasks such as listing messages, displaying folders, and composingand sending messages.

1. You must use the Browser Based Authentication API to enable access to the user's Yahoo! account through your Application.

2. You may not use the Yahoo! Mail Web Service API to mine or scrape user data from the user's Yahoo! account.

3. You may not use the Yahoo! Mail Web Service API to recreate a mimicked version of Yahoo! Mail on your site.

4. You may not use the Yahoo! Mail Web Service API to display the user's Yahoo! account information in a third party email client.

Page 3: yMailSDK

Table of Contents1. Getting Started ................................................................................................................. 1

Credential the User ...................................................................................................... 1Construct the SOAP Client ............................................................................................ 1Determine the User's Account Capabilities ....................................................................... 1

Account Types .................................................................................................... 2Calling GetUserData ............................................................................................ 2

Make Subsequent Calls ................................................................................................. 2Link Directly to a Message ............................................................................................ 3

Composing a New Message ................................................................................... 3Going Directly to a Message .................................................................................. 3

Batch Calls ................................................................................................................. 3Batch Call Chaining ............................................................................................. 3Passing Data ....................................................................................................... 4

2. Endpoints ....................................................................................................................... 5SOAP Endpoint ........................................................................................................... 5

SOAP Sample Request ......................................................................................... 5SOAP Sample Response ....................................................................................... 5

JSON-RPC Endpoint .................................................................................................... 6JSON-RPC Sample Request .................................................................................. 6JSON-RPC Sample Response ................................................................................ 6

3. Methods ......................................................................................................................... 9BatchExecute .............................................................................................................. 9

Parameters ......................................................................................................... 9Returns .............................................................................................................. 9Examples .......................................................................................................... 9

CreateFolder ............................................................................................................. 10Parameters ........................................................................................................ 10Returns ............................................................................................................ 10Examples ......................................................................................................... 11

DeleteMessages ......................................................................................................... 11Parameters ........................................................................................................ 11Returns ............................................................................................................ 11Examples ......................................................................................................... 11

DownloadAttachment ................................................................................................. 12Endpoints ......................................................................................................... 12Parameters ........................................................................................................ 12Error Codes ...................................................................................................... 13Examples ......................................................................................................... 13

EmptyFolder ............................................................................................................. 14Parameters ........................................................................................................ 14Returns ............................................................................................................ 14Examples ......................................................................................................... 14

FetchExternalMail ...................................................................................................... 15Parameters ........................................................................................................ 15Returns ............................................................................................................ 15Examples ......................................................................................................... 15

FlagMessages ............................................................................................................ 15Parameters ........................................................................................................ 15Returns ............................................................................................................ 16Example ........................................................................................................... 16

GetMessage .............................................................................................................. 16

iii

Page 4: yMailSDK

Parameters ........................................................................................................ 16Returns ............................................................................................................ 17Example ........................................................................................................... 17

GetMessageRawHeader .............................................................................................. 18Parameters ........................................................................................................ 18Returns ............................................................................................................ 19Example ........................................................................................................... 19

GetUserData ............................................................................................................. 19Returns ............................................................................................................ 20Example ........................................................................................................... 20

ListFolders ............................................................................................................... 21Parameters ........................................................................................................ 22Returns ............................................................................................................ 22Example ........................................................................................................... 22

ListMessages ............................................................................................................ 22Parameters ........................................................................................................ 23Returns ............................................................................................................ 23Example ........................................................................................................... 23

ListMessagesFromIds ................................................................................................. 24Parameters ........................................................................................................ 24Returns ............................................................................................................ 25

MoveMessages .......................................................................................................... 25Parameters ........................................................................................................ 25Returns ............................................................................................................ 25Example ........................................................................................................... 25

RemoveFolder ........................................................................................................... 26Parameters ........................................................................................................ 26Returns ............................................................................................................ 26Example ........................................................................................................... 26

RenameFolder ........................................................................................................... 27Parameters ........................................................................................................ 27Returns ............................................................................................................ 27

ResetSpamFilter ........................................................................................................ 27Parameters ........................................................................................................ 27Returns ............................................................................................................ 27

SaveMessage ............................................................................................................ 27Parameters ........................................................................................................ 27Returns ............................................................................................................ 28Example ........................................................................................................... 28

SaveRawMessage ...................................................................................................... 28Parameters ........................................................................................................ 29Returns ............................................................................................................ 29

SearchMessages ........................................................................................................ 29Parameters ........................................................................................................ 29Returns ............................................................................................................ 29Example ........................................................................................................... 30

SendMessage ............................................................................................................ 31Parameters ........................................................................................................ 31Returns ............................................................................................................ 31Example ........................................................................................................... 31

SetUserData .............................................................................................................. 32Parameters ........................................................................................................ 32

UploadAttachment ..................................................................................................... 32Endpoint .......................................................................................................... 32

iv

Yahoo! Mail Web Service User Guideand API Reference

Page 5: yMailSDK

Parameters ........................................................................................................ 32Returns ............................................................................................................ 32Error Codes (Upload related) ................................................................................ 33Error Codes (Virus related) .................................................................................. 33Example ........................................................................................................... 33

4. Data Types .................................................................................................................... 35Address .................................................................................................................... 35Alias ....................................................................................................................... 35AllAliases ................................................................................................................ 35AllDisposableAddress ................................................................................................. 35AllExternalAccounts .................................................................................................. 35AttachmentInfo ......................................................................................................... 36BatchCall ................................................................................................................. 36BatchResponse .......................................................................................................... 37BlockedAddresses ...................................................................................................... 37ComposeAddress ....................................................................................................... 37ComposeMessage ...................................................................................................... 38ComposeMessagePart ................................................................................................. 38DisposableAddress ..................................................................................................... 38ErrorCode ................................................................................................................ 39ErrorResponse ........................................................................................................... 39ExternalAccount ........................................................................................................ 39ExternalAccountAlias ................................................................................................. 39FetchResult ............................................................................................................... 40Fid .......................................................................................................................... 40Flag ......................................................................................................................... 40FolderData ................................................................................................................ 40Header ..................................................................................................................... 40InboxServices ........................................................................................................... 41MessageInfo ............................................................................................................. 41Message ................................................................................................................... 41MessagePart .............................................................................................................. 42MidRequest .............................................................................................................. 42SaveMessageDestination ............................................................................................. 42SaveMessagePart ....................................................................................................... 43SearchInfo ................................................................................................................ 43SearchAttachmentInfo ................................................................................................ 43SearchQuery ............................................................................................................. 43SetBlockedAddresses ................................................................................................. 44SetData .................................................................................................................... 44SetFeaturePref ........................................................................................................... 44SetFlag .................................................................................................................... 45SetUIPref ................................................................................................................. 45SetSendPref .............................................................................................................. 45SetSpamPref ............................................................................................................. 46SetSwitches .............................................................................................................. 46SetVacationPref ......................................................................................................... 46SimpleMessagePart .................................................................................................... 46SimpleMessageBody .................................................................................................. 47Switches .................................................................................................................. 47UserData .................................................................................................................. 47UserFeaturePref ......................................................................................................... 47UserPopPref ............................................................................................................. 48UserSendPref ............................................................................................................ 48

v

Yahoo! Mail Web Service User Guideand API Reference

Page 6: yMailSDK

UserSpamPref ........................................................................................................... 48UserUIPref ............................................................................................................... 49UserVacationPref ....................................................................................................... 49

5. Enumerations ................................................................................................................. 50DateType .................................................................................................................. 50FetchStatus ............................................................................................................... 50GroupBy .................................................................................................................. 50ImageBlockOption (Security Option) ............................................................................. 51IncludeMsgOnReply ................................................................................................... 51MidLocationRes ........................................................................................................ 51OffsetType ................................................................................................................ 51RichTextSignature ...................................................................................................... 52SearchAttachmentType ............................................................................................... 52SearchDateCheck ....................................................................................................... 52SortKey .................................................................................................................... 52SearchMatchMode ..................................................................................................... 52SortOrder ................................................................................................................. 53SearchSizeCheck ....................................................................................................... 53SearchRcptMode ....................................................................................................... 53SearchType ............................................................................................................... 53SearchWordBounds .................................................................................................... 53ShowCcBcc .............................................................................................................. 53UseRichText ............................................................................................................. 54UnknownContactAction .............................................................................................. 54

vi

Yahoo! Mail Web Service User Guideand API Reference

Page 7: yMailSDK

Chapter 1. Getting StartedThis section will help you to get quickly up and running using the Yahoo! Mail APIs.

In order to use the Yahoo! Mail APIs, you first need to access your user’s data, with their permission, usingBrowser-Based Authentication (BBAuth1). This guide assumes you already know how to get started withBBAuth2. See the BBAuth section on Yahoo! Developer Network for more information.

The following steps will show you how to access and start using the Yahoo! Mail APIs.

Code samples in this guide are written in PHP; however, other languages will have similar mappings.

Note

Currently, the Yahoo! Mail Web Service APIs cannot access Yahoo! Business Mail or Yahoo!Japan Mail accounts.

Credential the UserBefore you begin, you must follow the steps on the BBAuth3 quick start, and load the Web service sessionID (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.

Construct the SOAP ClientUse 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 IDand the WSSID. In addition, you must set the cookie header containing the cookie that was returned withthe WSSID when you credentialed the user in the previous step.

// Construct the URL encoded URL to send requests$location = "http://mail.yahooapis.com/ws/mail/v1.1/soap?appid= " . urlencode($appid) . "&WSSID=" . urlencode($wssid);// Construct the SOAP client$client = new SoapClient("http://mail.yahooapis.com/ws/mail/v1.1/wsdl",array("location" => $location));// Remove the leading "Y=" from the cookie string$credential = split("=", $cookie);// Set the "Y" cookie in the SOAP client$client->__setCookie("Y", $credential[1]);

Determine the User's Account CapabilitiesThe Yahoo! Mail Web Service limits the functionality available to free accounts. Premium accounts haveno such limits. First call the GetUserData method to get the user’s account type from the Web service.

1 http://developer.yahoo.com/auth/2 http://developer.yahoo.com/auth/3 http://developer.yahoo.com/auth/

1

Page 8: yMailSDK

Account Types• Premium Users

Premium users may access any part of the Web service. There are no restrictions.

• Non-Premium Users

Non-Premium users are restricted to the following APIs:

DeleteMessagesListMessagesListFolders

CreateFolderBatchExecuteGetUserData

RenameFolderRemoveFolderFetchExternalMail

EmptyFolderMoveMessages

Calls to other APIs will return an error. To upgrade to premium, go to mailplus.mail.yahoo.com4. For in-formation on how to receive a commission for upgrading users to a premium Yahoo! Mail Plus accountsee the Yahoo! Mail Web Service5 page on the Yahoo! Developer Network.

Calling GetUserDataCall GetUserData to find out the user’s level of service, as in the following example.

// Load the user data $userData = $client->GetUserData(); // Check whether the user has a premium account $isPremium = $userData->data->userFeaturePref->isPremium;

Make Subsequent CallsOnce you have determined the user’s level of service, you can make additional calls to Yahoo! Mail. Forexample, call the ListFolders method to get a list of folders that the user has in their mail account.

$folderList = $client->ListFolders();

Some methods require parameters passed as a single object parameter. For example, the following codecreates and passes to the ListMessages method a Request object containing which folder to fetchmessages from, where to start, and the number of messages to fetch.

// Build the request parameters$request = new stdclass();$request->fid = "Inbox"; // List the Inbox folder// Starting at the first position using the default sort order$request->startInfo = 0; // Fetch 20 message info objects$request->numInfo = 20; // Execute the list messages request$messageList = $client->ListMessages($request);

4 http://mailplus.mail.yahoo.com/5 http://developer.yahoo.com/mail/#commission

2

Getting Started

Page 9: yMailSDK

Link Directly to a MessageThe following links will allow you to link into a user’s mailbox from another application. They will recognizewhether the user is using beta mail or classic mail.

If you are not logged in already, it will force a login.

Composing a New Messagehttp://mrd.mail.yahoo.com/compose

Going Directly to a Messagehttp://mrd.mail.yahoo.com/msg?mid=[Yahoo! Mail message id]&fid=[Yahoo!Mail folder ID]

Batch CallsThe Yahoo! Mail Web Service6 has a call batching mechanism. Use the BatchExcecute method to executeup to five methods in a single call. Batch calls can be chained, so that each call is dependent on the previouscall’s successful execution. In addition, with the parameter field, each call can reference data specified bythe source and destination paths.

Batch Call ChainingEach batch call can have a dependency on the successful execution of other batch calls. To do this, add anid attribute to each batch call that must execute before any following calls. To subsequent batch calls, adda dependency tag that specifies the id of any calls that must successfully execute before this one. Callswith one or more dependencies will not execute unless all call(s) listed in its dependency tag have executed.

For example, the following SOAP request calls ListMessages and GetMessage. GetMessage is dependenton ListMessages and will not execute until it successfully executes.

<SOAP-ENV:Envelope><SOAP-ENV:Body><BatchExecute> <call id="listMessages"> <ListMessages startMid="0" numMid="5"> <fid>Inbox</fid> </ListMessages> </call> <call id="getMessages"> <parameter> <source>listMessages.mid</source> <destination>getMessages.mid</destination> </parameter> <dependency>listMessages</dependency> <GetMessage> <fid>Inbox</fid> </GetMessage> </call></BatchExecute></SOAP-ENV:Body></SOAP-ENV:Envelope>

6 http://developer.yahoo.com/mail/#commission

3

Getting Started

Page 10: yMailSDK

Passing DataYou can associate data with a batch call using the parameter tag which can contain a "source" and a "des-tination" path. The source path specifies the location, starting with a call ID, of a piece of data. The destin-ation path specifies the location, starting with the call ID of the current call, of a placeholder. Yahoo! Mailwill look up the source path and place that piece of data into the current call request at the location givenby the destination path.

The following example calls BatchExecute to create and rename a folder in one call.

// Construct the batch execute request$batchExecuteRequest = new stdclass();// Hold all of the calls being batched$batchExecuteRequest->call = array(); // Construct a request to construct a new folder named "Foo"$createRequest = new stdclass();$createRequest->CreateFolder = new stdclass();$createRequest->CreateFolder->name = "Foo";// Add the request to the batcharray_push($batchExecuteRequest->call, $createRequest); // Construct a request to rename the folder named "Foo" to "Bar"$renameRequest = new stdclass();$renameRequest->RenameFolder = new stdclass();$renameRequest->RenameFolder->fid = "Foo";$renameRequest->RenameFolder->name = "Bar";// Add the request to the batcharray_push($batchExecuteRequest->call, $renameRequest); // Execute the batch$response = $client->BatchExecute($batchExecuteRequest);

4

Getting Started

Page 11: yMailSDK

Chapter 2. EndpointsAll endpoints accept only POST requests. The requests themselves are serialized as XML, JSON or PHPand comprise the entire POST body. The request headers should indicate what content type the request isin. All endpoints accept and return UTF-8 data only.

SOAP EndpointSOAP 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 Sample Request<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ListMessages startMid="0" startInfo="0" numMid="10" numInfo="1"> <fid>Inbox</fid> </ListMessages> </SOAP-ENV:Body></SOAP-ENV:Envelope>

SOAP Sample Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ListMessagesResponse startMid="0" startInfo="0" numMid="10" numInfo="1"> <folder unread="5" total="19" size="10358178"> <folderInfo fid="Inbox" name="Inbox"/> </folder> <mid>1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM</mid> <mid>1_159_AKHPjkQAAGHKQyccZgnrGirdfks</mid> <mid>1_697_AKDPjkQAATdTQx+GBgWKY2C+E4I</mid> <mid>1_1269_AJrPjkQAAGACQx3P4gAgGnCwgUA</mid> <mid>1_1674_AKPPjkQAAD9pQxNdsQXkam+Ac+Q</mid> <mid>1_2319_AJrPjkQAARyyQwIc3gHTmApssKQ</mid> <mid>1_2888_AJ/PjkQAAJfZQv0SegHi008K510</mid> <mid>1_3504_AJvPjkQAANBLQv0NcwovmS4QtQg</mid> <mid>1_4112_AKHPjkQAAVulQswRLgjQF3B4YGw</mid> <mid>1_4676_AJrPjkQAAJjCQsXiUQ2lcSYHdMg</mid> <messageInfo mid="1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM" toEmail="[email protected]" 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" hasAttachment="0" inAddressBook="0"/> <from> <name>Yahoo! Local</name>

5

Page 12: yMailSDK

<email>[email protected]</email> </from> </messageInfo> </ListMessagesResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

JSON-RPC EndpointThe JSON-RPC endpoint implements the JSON-RPC spec1 on top of the Web service. Requests are seri-alized JavaScript following a specific data format. Each serialized JavaScript object contains the followingproperties:

• method: name of the API method being called.

• params: an array containing the method parameters.

• id (optional): the ID of the request, allows asynchronous clients to match a response back up with theoriginal request.

The service responds with serialized JavaScript as well. Once again, the JavaScript object follows aspecific data format:

• result: the return from the API method, must be null if there was an error.

• error: an error object resulting from the call being made (like an exception), must be null if therewas no error.

• id (optional): the ID specified in the request, if specified.

JSON-RPC Sample Request{"method":"ListMessages","params":[{"fid":"Inbox","startMid":0,"numMid":10,"startInfo":0,"numInfo":1}],"id":1234567890}

JSON-RPC Sample Response{"result":{"folder":{"folderInfo":{"fid":"Inbox",

1 http://json-rpc.org/wiki/specification

6

Endpoints

Page 13: yMailSDK

"name":"Inbox"},"total":19,"unread":5,"size":10358178},"mid":["1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM","1_159_AKHPjkQAAGHKQyccZgnrGirdfks","1_697_AKDPjkQAATdTQx+GBgWKY2C+E4I","1_1269_AJrPjkQAAGACQx3P4gAgGnCwgUA","1_1674_AKPPjkQAAD9pQxNdsQXkam+Ac+Q","1_2319_AJrPjkQAARyyQwIc3gHTmApssKQ","1_2888_AJ\/PjkQAAJfZQv0SegHi008K510","1_3504_AJvPjkQAANBLQv0NcwovmS4QtQg","1_4112_AKHPjkQAAVulQswRLgjQF3B4YGw","1_4676_AJrPjkQAAJjCQsXiUQ2lcSYHdMg"],"messageInfo":[{"flags":{"isReplied":0,"isFlagged":0,"isRead":0,"isDraft":0,"isForwarded":0,"isHam":0,"isSpam":0,"inAddressBook":0,"hasAttachment":0},"from":{"name":"Yahoo! Local","email":"[email protected]"},"inboxservices":[{"name":"allow","value":"all"},{"name":"sbc","value":"9ccfff"},{"name":"sih","value":"16"},{"name":"siu","value":"http:\/\/us.i1.yimg.com\/us.yimg.com\/a\/di\/direct\/y_16.gif"},{"name":"siw","value":"16"}],"mid":"1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM","toEmail":"[email protected]","subject":"Vote for your favorite spots in San Francisco, you could win a 2006 Mazda!","mimeType":"multipart\/alternative","externalPopServer":"",

7

Endpoints

Page 14: yMailSDK

"receivedDate":1127551268,"size":18714}],"numMid":10,"startMid":0,"numInfo":1,"startInfo":0},"error":null,"id":1234567890}

8

Endpoints

Page 15: yMailSDK

Chapter 3. MethodsYahoo! Mail Web service API methods.

BatchExecuteBatchExecute calls a series of specified API methods to be processed consecutively. Batch calls canbe dependency chained using the BatchCall id and dependency tags. Source and destination data for thecall to use can be specified by the BatchCall parameter tag.

Available to both premium and non-premium users.

Parameters

DescriptionName

BatchCall. API methods to call.call

Returns

DescriptionName

BatchResponseresponse

Examples

Request

Sample Request batch that calls FetchExternalMail and ListFolders.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:BatchExecute xmlns:m="urn:yahoo:ymws"> <call> <FetchExternalMail> <externalAccounts> <protocol>pop3</protocol> <userName>smithy</userName> <server>mail.company.com</server> </externalAccounts> </FetchExternalMail> </call> <call> <ListFolders> <resetMessengerUnseen>true</resetMessengerUnseen> </ListFolders> </call> </m:BatchExecute> </SOAP-ENV:Body></SOAP-ENV:Envelope>

9

Page 16: yMailSDK

Sample Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <BatchExecuteResponse> <response> <FetchExternalMailResponse> <fetchResults> <status/> <numFetched>0</numFetched> </fetchResults> </FetchExternalMailResponse> </response> <response> <ListFoldersResponse> <numberOfFolders>6</numberOfFolders> <folder unread="1" total="35" size="223097" isSystem="true"> <folderInfo fid="%40B%40Bulk" name="@B@Bulk"/> </folder> <folder unread="1" total="1" size="937" isSystem="true"> <folderInfo fid="Draft" name="Draft"/> </folder> <folder unread="543" total="589" size="11322299" isSystem="true"> <folderInfo fid="Inbox" name="Inbox"/> </folder> <folder unread="0" total="1" size="2521" isSystem="true"> <folderInfo fid="Sent" name="Sent"/> </folder> <folder unread="0" total="0" size="0" isSystem="true"> <folderInfo fid="Trash" name="Trash"/> </folder> <folder unread="0" total="0" size="0" isSystem="false"> <folderInfo fid="test" name="test"/> </folder> </ListFoldersResponse> </response> </BatchExecuteResponse> </SOAP-ENV:Body></SOAP-ENV:Envelopee>

CreateFolderCreateFolder adds a new personal folder to the user’s MyFolder list. Folder names can be letters,numbers, and the hyphen (-), space ( ), and underline (_) characters only.

Available for both premium and non-premium accounts.

Parameters

DescriptionName

Name for the new folder.name

Returns

DescriptionName

The ID and name of the new folder.folderInfo

10

Methods

Page 17: yMailSDK

Examples

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:CreateFolder xmlns:m="urn:yahoo:ymws"> <name>test</name> </m:CreateFolder> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <CreateFolderResponse> <folderInfo fid="test" name="test"/> </CreateFolderResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

DeleteMessagesDeleteMessages deletes the specified message(s) from the email account. Can supply a list of flagsto selectively delete messages.

Available to both premium and non-premium users.

Parameters

DescriptionName

Folder ID. Name and ID of the folder.fid

Message ID. Repeatable.mid

Flag for deleting messages that have the selection flag set. All messages will be deleted if anempty Flag object is passed and no mid is present in the request.

selection

Returns

DescriptionName

ErrorCode. Repeatableerror

Examples

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"

11

Methods

Page 18: yMailSDK

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:DeleteMessages xmlns:m="urn:yahoo:ymws"> <fid>Trash</fid> <mid>1_22_AOLIjkQAAAyqRPSgjwGI90KEyRM</mid> </m:DeleteMessages> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <DeleteMessagesResponse/> </SOAP-ENV:Body></SOAP-ENV:Envelope>

DownloadAttachmentDownloadAttachment downloads a file attached to a message. Anti-virus scanning can be performedand an error will be returned if a virus is detected.

Available to premium accounts only.

Endpointshttp://mail.yahooapis.com/ya/download

Virus Scanning Endpoint

http://mail.yahooapis.com/ya/avscan

ParametersQuery string arguments.

Yahoo! Mail New Style

DescriptionName

ID of the folder containing the message.fid

New style message ID of the message containing the attachment.mid

ID of the specific part to download.pid

Index of an individual attachment within a TNEF attachment (winmail.dat).tnef (optional)

If set to 1, the attachment needs scanning because it may have a virus. If set to 0, noscanning is required.

clean

If set to 1, download as inline. No content disposition is set in this case.inline

If a redirectURL is provided, and an error is encountered while downloading, the requestis sent to the redirect URL with an error code. If not provided, HTTP error codes are re-turned.

If while scanning it turns out that the attachment has a virus that cannot be cleaned, wedo not send back a download URL.

redirectURL

12

Methods

Page 19: yMailSDK

Error CodesVirus scanning related error codes:

MeaningError Code

Internal error.download_av_internal_error

Virus was detected.download_av_error

Attachment does not have a virus.download_av_no_virus

Attachment has a virus that can’t be cleaned.download_has_virus_cant_clean

Attachment had a virus and was cleaned.download_cleaned

Attachment is not virus scannable.download_not_scannable

Server is down.download_av_server_down

Attachment has a virus.download_has_virus

Other

Possible errors and their HTTP responses when no redirect URL is provided:

MeaningHTTP ResponseError Code

Invalid cookies404invalid_cookies

Server error.500could_not_open_udb

No credentials.404no_credentials

Failed to decrypt credentials.404cred_decrypt_failed

Could not open mailbox.404mailbox_open_err

tnef attachment not found.404tnef_not_found

tnef attachment does not exist for that parameter.404bad_tnef_param

Part not found.500part_not_found

Redirect URL is missing.500redirect_url_missing

Internal error.500internal_error

Attachment not found.500attachment_not_found

Examples

RequestGET /ya/download?mid=1_38188_AJ%2FPjkQAAEkmRE%2Fa9wVAADkU97c&fid=Inbox&pid=2&tnef=&clean=0&redirectURL=http%3A%2F%2Fweb32302.mail.mud.yahoo.com%2Fdc%2Fvirusresults.html%3Ffrom%3Ddownload_response%26ui%3Dlargewindow%26YY%3D1147203770155%26 HTTP/1.1

13

Methods

Page 20: yMailSDK

Response HTTP headerHTTP/1.1 200 OK Date: Tue, 09 May 2006 19:45:36 GMT P3P?: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV" Content-Disposition: attachment; filename="a10.htm" Cache-Control: private Connection: close Transfer-Encoding: chunked Content-Type: text/html Content-Encoding: gzip Set-Cookie: BX=2j8oac5261sb0&b=3&s=t9; expires=Tue, 02-Jun-2037 20:00:00 GMT; path=/; domain=.207.150

EmptyFolderEmptyFolder permanently deletes all messages in the specified folder.

Available for both premium and non-premium accounts.

Parameters

DescriptionName

Fid. Folder ID of the folder to empty.fid

Returns

DescriptionName

None

Examples

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:EmptyFolder xmlns:m="urn:yahoo:ymws"> <fid>Trash</fid> </m:EmptyFolder> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <EmptyFolderResponse/> </SOAP-ENV:Body></SOAP-ENV:Envelope>

14

Methods

Page 21: yMailSDK

FetchExternalMailFetchExternalMail retrieves messages from the user’s external mail account.

Available for both premium and non-premium accounts.

Parameters

DescriptionName

ExternalAccountexternalAccounts

Returns

DescriptionName

FetchResultfetchResults

Examples

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:EmptyFolder xmlns:m="urn:yahoo:ymws"> <fid>Trash</fid> </m:EmptyFolder> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <EmptyFolderResponse/> </SOAP-ENV:Body></SOAP-ENV:Envelope>

FlagMessagesFlagMessages sets a flag for one of more messages. Optionally can specify a set of messages to flagbased on existing flag settings, such as, flag only opened messages.

Available for premium accounts only.

Parameters

DescriptionName

Fid. Folder ID of messages to set flags for.sourceFid

15

Methods

Page 22: yMailSDK

DescriptionName

List of message IDs to set flags for.mid

SetFlag. Specifies which flag to set.setFlgas

Flag for flagging only messages that have selection flag set. All messages will be flagged ifan empty flag object is passed and no mid is present in the request.

selection

Returns

DescriptionName

ErrorCodereturnCodes

Example

Request

Set flag to read for messages in the bulk mail folder.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:FlagMessages xmlns:m="urn:yahoo:ymws"> <fid>%40B%40Bulk</fid> <selection/> <setFlags read="1"> </setFlags> </m:FlagMessages> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <FlagMessagesResponse/> </SOAP-ENV:Body></SOAP-ENV:Envelope>

GetMessageGetMessage fetches the content of the specified messages and puts them in the appropriate folder.

Available for premium accounts only.

Parameters

DescriptionName

Number of bytes to begin truncation of message.truncateAt

Fid. Folder ID.fid

List of message ids (deprecated).mid

16

Methods

Page 23: yMailSDK

DescriptionName

List of MidRequest objects which includes message ID and security parameters.message

Specifies the character set of the messagecharsetHint

Returns

DescriptionName

Total number of messages fetched.total

FolderDatafolder

List of Message. Only text/plain/HTML parts are populated with full message content (text).message

ErrorCodecode

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:GetMessage xmlns:m="urn:yahoo:ymws"> <fid>Inbox</fid> <message> <mid>1_326196_AIzJjkQAALMcRQlr7QE89VmzZIQ</mid> <enableWarnings>true</enableWarnings> <expandCIDReferences>true</expandCIDReferences> </message> <message> <mid>1_10615_AHPPjkQAANyjROs4vQW+byTLSnY</mid> <enableWarnings>true</enableWarnings> <expandCIDReferences>true</expandCIDReferences> </message> <message> <mid>1_12161_AH/PjkQAATjCROKQ3A3FGSkEl+U</mid> <enableWarnings>true</enableWarnings> <expandCIDReferences>true</expandCIDReferences> </message> <truncateAt>1024000</truncateAt> <transform-markup>remove-javascript</transform-markup> </m:GetMessage> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <GetMessageResponse> <total>1</total> <folder unread="441" total="492" size="10101880" isSystem="true"> <folderInfo fid="Inbox" name="Inbox"/> </folder> <message> <mid>1_326196_AIzJjkQAALMcRQlr7QE89VmzZIQ</mid> <receivedDate>1158245354</receivedDate> <subject>AAdvantage eSummary for Sept 06</subject>

17

Methods

Page 24: yMailSDK

<from> <name>AADVANTAGE</name> <email>[email protected]</email> </from> <replyto> <name>AADVANTAGE</name> <email>[email protected]</email> </replyto> <to> <name></name> <email>[email protected]</email> </to> <domainkey>false</domainkey> <part partId="HEADER" type="X-unknown" subtype="" typeParams="" disposition="" dispParams="" encoding="7bit" filename="" size="1174" isTruncated="true" contentId="" referencedInline="false"/> <part partId="TEXT" type="text" subtype="html" typeParams="charset=ISO-8859-1" disposition="" dispParams="" encoding="7bit" filename="" size="34474" isTruncated="true" contentId="" referencedInline="false"> <text>incoming mail message text</text> </part> </message> </GetMessageResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

GetMessageRawHeaderGetMessageRawHeader returns the full header for the specified message(s).

Available for premium accounts only.

Parameters

DescriptionName

Fidfid

List of message IDs to get raw headers for.mid

18

Methods

Page 25: yMailSDK

Returns

DescriptionName

Total number of messages fetched.total

Array of all the message headers.rawheaders

ErrorCodeerror

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:GetMessageRawHeader xmlns:m="urn:yahoo:ymws"> <fid>Inbox</fid> <mid>1_49265_AKxEv9EAAWXyQ5mV8AQaUR8y2Dg</mid> </m:GetMessageRawHeader> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <GetMessageRawHeaderResponse total="1"> <rawheaders>From Dylan Greene Fri Dec 9 06:27:58 2005Return-Path: &lt;[email protected]&gt;Authentication-Results: mta203.mail.scd.yahoo.comfrom=teacherreviews.com; domainkeys=neutral (no sig)Received: from 63.251.135.109 (EHLO ccm08.roving.com) (63.251.135.109)by mta203.mail.scd.yahoo.com with SMTP; Fri, 09 Dec 2005 06:34:23 -0800Received: from ws11 (unknown [10.200.200.61])by ccm08.roving.com (Postfix) with ESMTP id 8C1323C2915for &lt;[email protected]&gt;; Fri, 9 Dec 2005 09:27:58 -0500 (EST)Message-ID: &lt;1101152609431.1101151674506.1699.5.50931@scheduler&gt;From: Dylan Greene &lt;[email protected]&gt;Reply-To: [email protected]: [email protected]: TeacherReviews is back!MIME-Version: 1.0Content-type: text/plain; charset=iso-8859-1Content-Transfer-Encoding: 7bitDate: Fri, 9 Dec 2005 09:27:58 -0500 (EST)Content-Length: 582 </rawheaders> </GetMessageRawHeaderResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

GetUserDataGetUserData gets account information about the user from the mail server.

Available for both premium and non-premium accounts.

19

Methods

Page 26: yMailSDK

Returns

DescriptionName

UserDatadata

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <GetUserData> </GetUserData> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body> <GetUserDataResponse> <data> <userFeaturePref> <hasAddressGuard>false</hasAddressGuard> <intl>us</intl> <hasMailPlus>false</hasMailPlus> <hasStationery>false</hasStationery> <hasAds>true</hasAds> <mailboxQuota>1073741824</mailboxQuota> <quotaUsed>7048267</quotaUsed> <soundNewMail></soundNewMail> <mailCheckInterval>1</mailCheckInterval> <attachFiles>50</attachFiles> <attachFileSize>10485760</attachFileSize> <attachTotalSize>10485760</attachTotalSize> <attachTotalEncodedSize>13946061</attachTotalEncodedSize> <filtersMax>15</filtersMax> </userFeaturePref> <userUIPref> <composeFontFamily></composeFontFamily> <composeFontSize>0</composeFontSize> <defaultSortOrder>down</defaultSortOrder> <useRichText>dynamic</useRichText> <imageBlocking>b</imageBlocking> <msgPaneVisible>true</msgPaneVisible> <showTo>false</showTo> <newsCategory>entertainment</newsCategory> <showCalendarStrip>false</showCalendarStrip> <goOnMessageDelete>msg</goOnMessageDelete> </userUIPref> <userSpamPref> <spamGuardPlusEnabled>false</spamGuardPlusEnabled> <spamFilterActive>true</spamFilterActive> <spamMoveToInbox>true</spamMoveToInbox> <spamCleanupPeriod>14</spamCleanupPeriod> <spamBlockSender>true</spamBlockSender> </userSpamPref> <userVacationPref>

20

Methods

Page 27: yMailSDK

<vacationResponseOn>false</vacationResponseOn> <vacationResponseSubject></vacationResponseSubject> <vacationResponseText></vacationResponseText> <vacationResponseDomain0></vacationResponseDomain0> <vacationResponseDomain1></vacationResponseDomain1> <vacationResponseStartDate></vacationResponseStartDate> <vacationResponseEndDate></vacationResponseEndDate> </userVacationPref> <userSendPref> <defaultID>[email protected]</defaultID> <defaultFromName></defaultFromName> <defaultFromAddress>[email protected]</defaultFromAddress> <defaultReplyToAddress></defaultReplyToAddress> <canSendFromPopAcct>false</canSendFromPopAcct> <showCcBcc>hide</showCcBcc> <includeMsgOnReply>short</includeMsgOnReply> <signatureActive>false</signatureActive> <signatureText></signatureText> <richTextSignature>plain</richTextSignature> <addUnknownContact>unspecified</addUnknownContact> <autosaveOnSend>no</autosaveOnSend> </userSendPref> <userPopPref> <hasPOP>false</hasPOP> <popNoBulk>false</popNoBulk> <popBulkSubjectPrefix>false</popBulkSubjectPrefix> </userPopPref> <externalAccounts extAccountsTotal="1"> <extAccount accountName="work" fromName="" address="" replyTo="" server="mail.company.com" username="smithy" colorIndicator="r" folder="Inbox" port="110" leaveMail="false" retrieveOnlyNew="false" useFilters="false" isDefault="false"/> </externalAccounts> <disposableAddresses deaNamesTotal="0"/> <aliases aliasesTotal="0"/> <otherYahooMboxes otherYahooMboxesTotal="0"/> <blockedAddresses blockedAddressesTotal="65" blockedAddressesMax="1"> <blockedAddress>[email protected]</blockedAddress> </blockedAddresses> <switches> <noFormWarning>false</noFormWarning> </switches> </data> </GetUserDataResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

ListFoldersListFolders returns a list of folders from user’s account.

Available for both premium and non-premium accounts.

21

Methods

Page 28: yMailSDK

Parameters

DescriptionName

Reset unseen messages icon in Yahoo! Messenger.resetMessageUnseen

Returns

DescriptionName

Total number of folders to list.numberOfFolders

List of FolderData.folder

Example

Request<SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:ListFolders xmlns:m="urn:yahoo:ymws"> <resetMessengerUnseen>true</resetMessengerUnseen> </m:ListFolders> </SOAP-ENV:Body></SOAP-ENV:Envelope

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ListFoldersResponse> <numberOfFolders>5</numberOfFolders> <folder unread="8" total="8" size="18304" isSystem="true"> <folderInfo fid="%40B%40Bulk" name="@B@Bulk"/> </folder> <folder unread="1" total="1" size="937" isSystem="true"> <folderInfo fid="Draft" name="Draft"/> </folder> <folder unread="560" total="617" size="11663659" isSystem="true"> <folderInfo fid="Inbox" name="Inbox"/> </folder> <folder unread="0" total="1" size="2521" isSystem="true"> <folderInfo fid="Sent" name="Sent"/> </folder> <folder unread="0" total="1" size="679" isSystem="true"> <folderInfo fid="Trash" name="Trash"/> </folder> </ListFoldersResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

ListMessagesListMessages returns a list of messages for the specified user from the Yahoo! Mail Web Service. Youcan specify a set of Messages IDs, and/or the complete message.

22

Methods

Page 29: yMailSDK

Available for both premium and non-premium accounts.

Parameters

DescriptionName

SortKeysortKey

SortOrdersortOrder

Fid. Folder ID and name.fid

Flag Used to filter by flags.filterBy

GroupBy. Used to group messages (unread first, etc).groupBy

First message ID to return.startMid

Number of message IDs to return.numMid

First message info to return.startInfo

Number of message infos to return.numInfo

Message ID to center on.offSetMid

OffsetType. Used to decide how to center on the Mid.loc

Returns

DescriptionName

FolderDatafolder

Unbounded list of message IDs.mid

List of MessageInfo.messageInfo

Starting message ID.startMid

Number of messages IDs to get.numberMid

Where to start getting full messages.startInfo

Number of full messages to get.numInfo

MidLocationResloc

GroupBygroupBy

Example

Request<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ListMessages startMid="0" startInfo="0" numMid="10" numInfo="1"> <fid>Inbox</fid> </ListMessages> </SOAP-ENV:Body></SOAP-ENV:Envelope>

23

Methods

Page 30: yMailSDK

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ListMessagesResponse startMid="0" startInfo="0" numMid="10" numInfo="1"> <folder unread="5" total="19" size="10358178"> <folderInfo fid="Inbox" name="Inbox"/> </folder> <mid>1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM</mid> <mid>1_159_AKHPjkQAAGHKQyccZgnrGirdfks</mid> <mid>1_697_AKDPjkQAATdTQx+GBgWKY2C+E4I</mid> <mid>1_1269_AJrPjkQAAGACQx3P4gAgGnCwgUA</mid> <mid>1_1674_AKPPjkQAAD9pQxNdsQXkam+Ac+Q</mid> <mid>1_2319_AJrPjkQAARyyQwIc3gHTmApssKQ</mid> <mid>1_2888_AJ/PjkQAAJfZQv0SegHi008K510</mid> <mid>1_3504_AJvPjkQAANBLQv0NcwovmS4QtQg</mid> <mid>1_4112_AKHPjkQAAVulQswRLgjQF3B4YGw</mid> <mid>1_4676_AJrPjkQAAJjCQsXiUQ2lcSYHdMg</mid> <messageInfo mid="1_10690_AKPPjkQAAHsRQzU1aAAnSyXpatM" toEmail="[email protected]" 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" hasAttachment="0" inAddressBook="0"/> <from> <name>Yahoo! Local</name> <email>[email protected]</email> </from> </messageInfo></ListMessagesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

ListMessagesFromIdsListMessagesFromIds returns a list of messages for the specified user from the Yahoo! Mail WebService by specifying the IDs of the messages to fetch.

Available for premium accounts only.

Parameters

DescriptionName

Fid. Optional. Folder to get the messages from.fid

List of message IDs.mid

24

Methods

Page 31: yMailSDK

Returns

DescriptionName

FolderDatafolder

List of MessageInfomessageInfo

MoveMessagesMoveMessages moves a message or group of messages to another folder.

Available for both premium and non-premium accounts.

Parameters

DescriptionName

Source folder ID.sourceFid

Destination folder ID.destinationFid

Message ID. This can be repeated for each message to be moved.mid

Move messages matching the selection flags. All messages will be moved if an emptyflags object is passed and no mid is present in the request.

selection

Returns

DescriptionName

FolderData. Source folder data.sourceFolder

FolderData. Destination folder data.destinationFolder

New message ID's (repeatable).mid

ErrorCodeerror

Example

Request

This SOAP request moves a message to the trash folder.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:MoveMessages xmlns:m="urn:yahoo:ymws"> <sourceFid>Inbox</sourceFid> <destinationFid>Trash</destinationFid> <mid>1_1443_AC/IjkQAAAqdRQNBbQGcQHAxXAY</mid> </m:MoveMessages> </SOAP-ENV:Body></SOAP-ENV:Envelope>

25

Methods

Page 32: yMailSDK

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <MoveMessagesResponse> <sourceFolder unread="560" total="616" size="11661067" isSystem="true"> <folderInfo fid="Inbox" name="Inbox"/> </sourceFolder> <destinationFolder unread="0" total="1" size="2592" isSystem="true"> <folderInfo fid="Trash" name="Trash"/> </destinationFolder> <mid>1_142_AC/IjkQAAAqdRQNBbQGcQHAxXAY</mid> </MoveMessagesResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

RemoveFolderRemoveFolder deletes the specified folder. Only personal folders can be deleted.

Available for both premium and non-premium accounts.

Parameters

DescriptionName

Fid. Folder ID and name of folder to remove.fid

Returns

DescriptionName

Indicates folder was successfully removed.RemoveFolderResponse

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:RemoveFolder xmlns:m="urn:yahoo:ymws"> <fid>untitled</fid> </m:RemoveFolder> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <RemoveFolderResponse/> </SOAP-ENV:Body></SOAP-ENV:Envelope>

26

Methods

Page 33: yMailSDK

RenameFolderRenameFolder renames the specified folder from the users my folders list. Only personal folders canbe renamed.

Available for both premium and non-premium accounts.

Parameters

DescriptionName

Fid. Folder ID and name of folder to rename.fid

Name for new folder.name

Returns

DescriptionName

Fid. Folder ID and name of renamed folder.FolderInfo

ResetSpamFilterResetSpamFilter clears the user’s spam filter profile.

Available for premium accounts only.

Parameters

DescriptionName

None

Returns

DescriptionName

None

SaveMessageSave the user’s message.

Available for premium accounts only.

Parameters

DescriptionName

SaveMessageDestinationdestination

ComposeMessagemessage

27

Methods

Page 34: yMailSDK

Returns

DescriptionName

Message ID.mid

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:SaveMessage xmlns:m="urn:yahoo:ymws"> <message messageType="new"> <to> <email>[email protected]</email> </to> <from> <email>[email protected]</email> </from> <simplebody> <text>save me</text> <html>&lt;html&gt;&lt;head&gt;&lt;style type="text/css"&gt;&lt;!-- DIV {margin:0px;} --&gt;&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div style="font-family:times new roman, new york, times, serif;font-size:12pt"

&gt;&lt;DIV&gt;save me&lt;/DIV&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt; </html> </simplebody> <subject>save?</subject> </message> <destination> <fid>Draft</fid> </destination> </m:SaveMessage> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SaveMessageResponse> <mid>1_469_AIvJjkQAAFnmRQnUfAuFtxE6sCM</mid> </SaveMessageResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

SaveRawMessageSaveRawMessage saves the body and header of the message. Useful for importing messages from an-other source into Yahoo! Mail.

Available for premium accounts only.

28

Methods

Page 35: yMailSDK

Parameters

DescriptionName

Fid. Folder ID and name.fid

Base64 encoded MIME messagetext

Returns

DescriptionName

New message IDmid

SearchMessagesSearchMessages searches for messages based on certain criteria. Search results can be returned asonly the message id, with message information, or a combination of both. For example, to improve per-formance, you can request search results with summary information for the number of results that can bedisplayed on the screen, and only request message IDs for the remainder. As the user asks to see moreresults, the message IDs can be used to more quickly obtain additional message details.

The response denotes found search terms in the MessageInfo | Snippets tag by surrounding the foundterm with “^_”. For example: ^_search term^_.

Available for premium accounts only.

Parameters

DescriptionName

SortKey. The key used to sort the results.sortKey

SortOrder. Up or down. List results either up or down.sortOrder

Text. Text to find in messages.search

GroupBy. Optional flag used to group messages.groupBy

Optional starting message ID position.startMid

Optional starting point to retrieve messages with MessageInfo.startInfo

Number of messages to retrieve as message IDs.numMid

Number of messages as MessageInfo retrieved.numInfo

Returns

DescriptionName

Fid. Folder ID.folder

Comma separated list of message IDs.mid

List of MessageInfo.messageInfo

First returned message as a message ID.startMid

Number of messages returned as a message ID.numMid

29

Methods

Page 36: yMailSDK

DescriptionName

First returned message with MessageInfo.sartInfo

Number or messages returned with MessageInfo.numInfo

OffsetTypeloc

GroupBy. Flag used to group returned messages.groupBy

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:SearchMessages xmlns:m="urn:yahoo:ymws" startMid="0" numMid="300" startInfo="0" numInfo="50"> <sortKey>date</sortKey> <sortOrder>down</sortOrder> <transform-markup>remove-javascript</transform-markup> <search> <query>gearmail</query> </search> </m:SearchMessages> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SearchMessagesResponse startMid="0" startInfo="0" numMid="1" numInfo="1"> <folder unread="0" total="1" size="0" isSystem="true"> <folderInfo fid="%40S%40Search" name="@S@Search"/> </folder> <mid>1_22_1_62655_0_AKVEv9EAAHv+Q3S4CQG01TYO2EM</mid> <messageInfo mid="1_22_1_62655_0_AKVEv9EAAHv+Q3S4CQG01TYO2EM" toEmail="[email protected]" subject="REI-OUTLET: Holiday Deals Just Added" mimeType="text/html" externalPopServer="" receivedDate="1131722754" size="12420"> <flags isReplied="0" isFlagged="0" isRead="1" isDraft="0" isForwarded="0" isHam="0" isSpam="0" hasAttachment="0" inAddressBook="0"/> <from> <name>REI Gearmail</name> <email>[email protected]</email> </from> <searchinfo> <snippets> ... images or links? View this e-mail here: www.rei.com/gm REI ^_Gearmail^_ ® November 11, 2005 At REI-OUTLET we're grinning from ear ... gloves! Make sure you receive your e-mail from REI. Add REI_^_Gearmail^[email protected] to your address book. Unsubscribe or Change Your ...

30

Methods

Page 37: yMailSDK

</snippets> <matchedFields>from</matchedFields> <matchedFields>body</matchedFields> </searchinfo><folderInfo fid="%40S%40Search" name="@S@Search"/> <sourceFolderInfo fid="Inbox" name="Inbox"/> </messageInfo> </SearchMessagesResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope

SendMessageSendMessage sends a new email message to another user.

Available for premium accounts only.

Parameters

DescriptionName

ComposeMessagemessage

Whether to save a copy of the message.savecopy

ReturnsNone.

Example

Request<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:SendMessage xmlns:m="urn:yahoo:ymws"> <message> <to> <email>[email protected]</email> </to> <from> <email>[email protected]</email> </from> <simplebody> <text>this is a test</text> <html>&lt;html&gt;&lt;head&gt;&lt;style type="text/css"&gt;&lt; !-- DIV {margin:0px;} </html> </simplebody> <subject>test</subject> </message> </m:SendMessage> </SOAP-ENV:Body></SOAP-ENV:Envelope>

31

Methods

Page 38: yMailSDK

Response<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SendMessageResponse/> </SOAP-ENV:Body></SOAP-ENV:Envelope>

SetUserDataSetUserData makes changes to a user’s email profile.

Available for premium accounts only.

Parameters

DescriptionName

SetDatasetdata

UploadAttachmentUploadAttachment uploads an email attachment. Must be a POST request.

Available for premium accounts only.

Endpointhttp://mail.yahooapis.com/ya/upload

ParametersPOST arguments

DescriptionName

Path to the file to be uploaded.uploadfile

URL to redirect to, once the upload is completed, with or without success. If this is not provided,the response is returned as XML

resulturl

Optional parameter to denote the encoding for the filename_charset_

ReturnsThe request can return the HTTP code 404 or 302.404: Possible causes:

• UDB open failed

• Request was not a POST

302: Redirects to the resulturl with the following additional parameters

32

Methods

Page 39: yMailSDK

DescriptionParameter

see belowerrorcode

Actual name of the file.filename

Name as stored on the disk, a generated random string. This is subsequently passed as partof SendMessage (also see ComposeMessagePart) for the file to be picked up when theactual message is sent.

diskfilename

MIME type of the attachment.mimetype

Size in bytes of the attachment.filesize

Error Codes (Upload related)

DescriptionError code

Request doesn't have proper credentialsuploadAuthError

File size is larger than currently supporteduploadFileSizeError

File not specifieduploadNoFileError

File was partially uploadeduploadPartialFileError

Internal error with the upload scriptuploadInternalError

Error Codes (Virus related)

DescriptionError code

Failure during scanuploadAVInternalError

AV server had problems during scanuploadAVError

No virus detecteduploadAVNoVirus

Virus could not be cleaneduploadAVCannotClean

Virus cleaned successfullyuploadAVCleaned

File is not scannableuploadAVNotScannable

AV server is downuploadAVServerDown

File has virusuploadAVHasVirus

Example

Example Outputerrorcode=uploadAVNoVirus&filename=yapache-talk-20020425.ppt&diskfilename=1f967432e356d6b63c83632957100736&mimetype=application%2Fvnd.ms-powerpoint&filesize=183296

Example XML Response

If a result URL is not provided, the response is returned as XML.

<?xml version="1.0" encoding="UTF-8"?><Response><attachment><code>uploadAVNoVirus</code><id>79224c8c83571e2cd1ac573c4c962f9f</id>

33

Methods

Page 40: yMailSDK

<name>notepad_resume.txt</name><type>text/plain</type><size>2352</size></attachment></Response>

34

Methods

Page 41: yMailSDK

Chapter 4. Data TypesData types are used by the Yahoo Mail API methods.

AddressMeaningName

Personal namename

Email addressemail

AliasMeaningName

Sender's namefromName

Sender's addressaddress

The email address that should receive any replyreplyTo

Color to display for mail sent to this aliascolorIndicator

Digital signaturesignature

Add digital signature to messagesaddSignature

Indicates the type of digital signing and verification usedsignatureType

Specifies whether this is the default aliasisDefault

AllAliasesMeaningName

List of Aliasesalias

Number of AliasesaliasesTotal

AllDisposableAddressMeaningName

List of DisposableAddressdeaName

Number of disposable addressesdeaNamesTotal

AllExternalAccountsMeaningName

List of ExternalAccountAliasextAccount

Number of external accountsextAccountsTotal

35

Page 42: yMailSDK

AttachmentInfoMeaningName

Name of the attachment filename

Size in bytes of the attachmentsize

ID identifying the attachmentid

BatchCallMeaningName

An (optional) unique identifier for the BatchCall. The ID can be used byother calls to reference this call.

id

An array of strings containing BatchCall IDs. The dependency field specifieswhich other batched calls must execute successfully before executing this call.

dependency

An array of BatchParameter objects. Each BatchParameter containsa "source" and a "destination" path. The source path specifies the location,

parameter

starting with a call ID, of a piece of data. The destination path specifies the loc-ation, starting with the call ID of the current call, of a placeholder. Yahoo! Mailwill look up the source path and place that piece of data into the current call re-quest at the location given by the destination path.

CreateFolderCreateFolder

EmptyFolderEmptyFolder

FetchExternalMailFetchExternalMail

FlagMessagesFlagMessages

GetMessageGetMessage

GetMessageRawHeaderGetMessageRawHeader

GetUserDataGetUserData

ListFoldersListFolders

ListMessagesListMessages

ListMessagesFromIdsListMessagesFromIds

MoveMessagesMoveMessages

RemoveFolderRemoveFolder

RenameFolderRenameFolder

ResetSpamFilterResetSpamFilter

SaveMessageSaveMessage

SaveRawMessageSaveRawMessage

SearchMessagesSearchMessages

SendMessageSendMessage

SetUserDataSetUserData

36

Data Types

Page 43: yMailSDK

BatchResponseMeaningName

Return from CreateFolderCreateFolderResponse

Return from DeleteMessagesDeleteMessagesResponse

Return from EmptyFolderEmptyFolderResponse

ErrorResponseErrorResponse

Return from FetchExternalMailFetchExternalMailResponse

Return from FlagMessagesFlagMessagesResponse

Return from GetMessageRawHeaderGetMessageRawHeaderResponse

Return from GetMessageGetMessageResponse

Return from GetUserDataGetUserDataResponse

Return from ListFoldersListFoldersResponse

Return from ListMessagesFromIdsListMessagesFromIdsResponse

Return from ListMessagesListMessagesResponse

Return from MoveMessagesMoveMessagesResponse

Return from RemoveFolderRemoveFolderResponse

Return from RenameFolderRenameFolderResponse

Return from ResetSpamFilterResetSpamFilterResponse

Return from SaveRawMessageSaveRawMessageResponse

Return from SearchMessagesSearchMessagesResponse

Return from SendMessageSendMessageResponse

Return from SetUserDataSetUserDataResponse

BlockedAddressesMeaningName

String array of email addresses to be blockedblockedAddress

Count of blocked addressesblockedAddressesTotal

Maximum number of blocked addresses allowedblockedAddressesMax

ComposeAddressMeaningName

Personal name. Can be either email or nickname.

email: email address of the recipient

name

nickname: address book nickname of the recipient or distribution list

37

Data Types

Page 44: yMailSDK

ComposeMessageMeaningName

Subject for messagesubject

In reply to this message, if any.inreplyto

Source email ComposeAddressfrom

Destination email ComposeAddressto

Reply to email ComposeAddressreplyto

ComposeAddresscc

ComposeAddressbcc

ComposeMessagePartbody

Meta datameta

SimpleMessageBodysimplebody

ComposeMessagePartMeaningName

The content of the partdata

ComposeMessagePartsubparts

This is of the form "upload://diskfilename", where diskfilename is the one re-turned by the Upload Attachment method

attachment

MIME multi-part message typetype

MIME multi-part message sub-typesubtype

Type of encoding: 7bit, 8bit/binary, quoted-printable, or base64encoding

Filename of the attachmentfilename

Character set of contentcharset

Unique identifier for the partcontendid

How information is presented to the user: inline or attachmentdisposition

DisposableAddressMeaningName

Email addressaddress

The email address that should receive any replyreplyTo

Indicates reason the account was creatednotes

Color to display for mail sent to this addresscolorIndicator

Destination addressdeliverTo

Name to use for mail sent from this addressfromName

Indicates that user wants to send mail from this addressactiveComposition

38

Data Types

Page 45: yMailSDK

ErrorCodeMeaningName

MessageIDmid

Error codecode

ErrorResponseMeaningName

QNamecode

Error stringstring

SOAP-ENV:detaildetail

ExternalAccountMeaningName

Account protocol, as returned from GetUserDataprotocol

Account username, as returned from GetUserDatauserName

Account server, as returned from GetUserDataserver

ExternalAccountAliasMeaningName

Name for the external accountaccountName

Name of the senderfromName

Address of the external accountaddress

The email address that should receive any replyreplyTo

Server hosting the external accountserver

User name for the external accountusername

Color to display for mail sent to this addresscolorIndicator

Folder where external account emails are placedfolder

Port used for sending and receiving messages for this accountport

Whether to delete messages on serverleaveMail

Whether to retrieve only new messages for this accountretrieveOnlyNew

Whether to filter messages sent to this accountuseFilters

Whether this is the default e-mail accountisDefault

39

Data Types

Page 46: yMailSDK

FetchResultMeaningName

FetchStatusstatus

Total messages fetchednumFetched

FidMeaningName

Folder ID. ID of the folder containing the messagefid

Folder namename

FlagMeaningName

Message has been replied toisReplied

User has flagged the messageisFlagged

Message has been readisRead

Message is a draftisDraft

Message is UU encodedisUUEncoded

Message has been forwardedisForwarded

User has marked as not spamisHam

The message is spamisSpam

The message has an attachmenthasAttachment

the sender is in the user’s address bookinAddressBook

FolderDataMeaningName

Fid. ID of the folder containing the messagefolderInfo

Unread message count (not returned for search folder)unread

Total message count (total matches for search folder)total

Folder size in bytessize

Boolean indicating whether this is a system folderisSystem

HeaderMeaningName

Keyname

Valuevalue

40

Data Types

Page 47: yMailSDK

InboxServicesMeaningName

Name in name/value pairname

Value in name/value pairvalue

MessageInfoMeaningName

Flagflags

The address the message was sent fromfrom

SearchInfo Only returned for search resultssearchinfo

An array of InboxServicesinboxservices

Fid. Folder name and IDfolderInfo

Fid. ID of the folder containing the message. Only returned for search resultssourceFolderInfo

The destination addresstoEmail

The subject title of the messagesubject

Top level MIME typemimeType

Message IDmid

External POP serverexternalPopServer

Epoch datereceivedDate

The size of the message in bytessize

MessageMeaningName

Message IDmid

Date message was receivedreceivedDate

Content of the subject linesubject

Address of the senderfrom

The email address that should receive any replyreplyto

Address of the recipientto

CC’d addressescc

BCC’d addressesbcc

Domain key used to authenticate the messagedomainkey

Name of the domain keydomainkeyname

MessagePartpart

Whether the message has images blocked from viewhasBlockedImages

41

Data Types

Page 48: yMailSDK

MessagePartMeaningName

Unique identifier for the message partpartId

MIME multi-part message typetype

MIME multi-part message sub-typesubtype

Type parameterstypeParams

How information is presented to the user: inline or attachmentdisposition

Disposition parametersdispParams

Type of encoding: 7bit, 8bit/binary, quoted-printable, or base64encoding

Filename if this is an attachmentfilename

Size in bytes of the partsize

If the message body is truncatedisTruncated

Unique identifier for the partcontentId

If the part is referenced inline by another part of the messagereferencedInline

Part contenttext

AttachmentInfoattachments

MidRequestMeaningName

Message IDmid

Security option to block images ImageBlockOptionblockImages

Security option to restrict CSSrestrictCSS

URL to replace blocked imagesimgReplacementURL

Security option to expand CID referencesexpandCIDReferneces

Security option to enable warnings on links, forms and password fields JavaScriptcallback functions are:

showLinkWarning()

enableWarnings

showFormWarning()

showPasswordWarning()

SaveMessageDestinationMeaningName

Fid. ID of the folder containing the messagefid

Message IDmid

42

Data Types

Page 49: yMailSDK

SaveMessagePartMeaningName

Unique identifierpartId

MIME multi-part message typetype

MIME multi-part message sub-typesubType

Type parameters. Provide more details about the data, if required. Each parameter ispreceded by a semicolon and is expressed as an attribute/value pair, separated by anequal (=) sign. For example, attribute=value.

typeParams

How information is presented to the user: inline or attachmentdisposition

Disposition parameters as attribute/value pairsdispParams

Type of encoding: 7bit, 8bit/binary, quoted-printable, or base64encoding

Filename of the partfilename

Size of the filesize

Whether the message body is truncatedisTruncated

Content ID that references the partcontentId

Whether the part is referenced inline by another part of the messagereferencedInline

Part contenttext

Aliasattachments

SearchInfoMeaningName

Search result snippetsnippets

Unbounded list of fields matched (subject, body, attachment content, etc)matchedFields

SearchAttachmentInfoattachments

SearchAttachmentInfoMeaningName

Filenamename

MIME multi-part message typeMIMEType

MIME part IDMIMEPartid

Size in bytessize

URL to a thumbnail for this attachmentthumbnailURL

SearchQueryMeaningName

SearchAttachmentTypeattachment

43

Data Types

Page 50: yMailSDK

MeaningName

String to run the search onquery

String describing the senderfrom

SearchMatchModefrommatchmode

String describing the recipient of the messagercpt

SearchMatchModercptmatchmode

String describing the subject to matchsubject

SearchMatchModesubjectmatchmode

String to search for in the bodybody

SearchMatchModebodymatchmode

SearchTypesearchtype

Date parameter for the searchdate

SearchDateCheckdatemode

String of folder IDs to search infid

Flagflags

SetBlockedAddressesMeaningName

String array of email addresses to be blockedblockedAddress

SetDataMeaningName

SetFeaturePrefuserFeaturePref

SetUIPrefuserUIPref

SetSpamPrefuserSpamPref

SetVacationPrefuserVacationPref

SetSendPrefuserSendPref

Set POP PreferencesuserPopPref

SetBlockedAddressesblockedAddresses

Set switchesswitches

SetFeaturePrefMeaningName

Play a sound when new mail is receivedsoundNewMail

Integer. Frequency in days to check for new mailmailCheckInterval

44

Data Types

Page 51: yMailSDK

SetFlagMeaningName

Message has been replied toreplied

Message has been flagged by userflagged

Message has been readread

Message is a draftdraft

Message has been forwardedforwarded

Messages has been marked as not spam by userham

Message is spamspam

SetUIPrefMeaningName

Font family to use when composing messagescomposeFontFamily

Sort orderdefaultSortOrder

Use rich textuseRichText

String, supporting 0 (don't block), 1 (block all) or 2 (Only from my contacts andCertified senders)

imageBlocking

Toggles whether the message pane is visible to the usermsgPaneVisible

Show a column for the message recipient when viewing folders, for DEA/Address-Guard users only

showTo

String indicating the news category to be displayed on the welcome page. For ex-ample, "topstories".

newsCategory

Boolean indicating whether the calendar strip is on/offshowCalendarStrip

String, indicating if the user should be taken back to the folder (box) or the nextmessage (msg) upon deleting a message

goOnMessageDelete

SetSendPrefMeaningName

Default from namedefaultID

Default from namedefaultFromName

Default reply to addressdefaultReplyToAddress

Show CC and BCC fieldsshowCcBcc

Include Message on replyincludeMsgOnReply

Add a signature to outgoing messagessignatureActive

Text to be added if signatureActive is TruesignatureText

Use rich text formating in the signaturerichTextSignature

UnknownContactActionaddUnknownContact

String, can be either "yes" or "no"autosaveOnSend

45

Data Types

Page 52: yMailSDK

MeaningName

Two settings are available:popNoBulk and popBulkSubjectPrefixSetPopPref

• popNoBulk: If True, don’t import bulk mail (spam).

• popBulkSubjectPrefix: If True, add prefix to bulk mail (spam)

SetSpamPrefMeaningName

Move spam to inbox.spamMoveToInbox

Integer, in days. Specifies how often to remove spam from mailbox.spamCleanupPeriod

Add sender’s address to blocked addresses when mail is marked as spam by the user.spamBlockSender

SetSwitchesMeaningName

Boolean, indicating whether or not a warning is to be displayed on form submitnoFormWarning

SetVacationPrefMeaningName

BooleanvacationResponseOn

Subject for vacation response emailvacationResponseSubject

Text of vacation response emailvacationResponseText

Not supportedvacationResponseDomain0

Not supportedvacationResponseDomain1

Unix time stamp, as a stringvacationResponseStartDate

Unix time stamp, as a stringvacationResponseEndDate

SimpleMessagePartMeaningName

Text of the parttext

HTML version of the parthtml

This is in the form of “upload://diskfilename", where diskfilenameis the one returned by the UploadAttachment method

attachment

URL string to replace blocked imagesimgReplacementURL

46

Data Types

Page 53: yMailSDK

SimpleMessageBodyMeaningName

Text of the message bodytext

HTML version of the message body.html

In the form "upload://id", where id is returned by the Upload Attachment methodattachment

SwitchesMeaningName

Boolean, indicating whether or not a warning is to be displayed on form submitnoFormWarning

UserDataMeaningName

UserFeaturePrefuserFeaturePref

UserUIPrefuserUIPref

UserSpamPrefuserSpamPref

UserVacationPrefuserVacationPref

UserSendPrefuserSendPref

UserPopPrefuserPopPref

ExternalAccountexternalAccounts

AllDisposableAddressdisposableAddresses

AllAliasesaliases

AllOtherYahooMboxesotherYahooMboxes

BlockedAddressesblockedAddresses

Switchesswitches

UserFeaturePrefMeaningName

Maximum number of files user is allowed to attachattachFiles

Maximum size, in bytes, of each attached fileattachFileSize

Total encoded size, in bytes, of all attached filesattachTotalEncodedSize

Total encoded size, in bytes, of all attached filesattachTotalSize

Number of external accountsextAccountsTotal

User has Address GuardhasAddressGuard

If basic account, ads will be shownhasAds

User has a mail plus accounthasMailPlus

User has stationaryhasStationery

47

Data Types

Page 54: yMailSDK

MeaningName

Language settingintl

Whether user has a premium account (Mail plus, etc.)isPremium

Maximum size allowed in bytes. One gigabyte for standard account, two giga-bytes for premium accounts

mailboxQuota

Integer. Interval in which to check for new mail messagesmailCheckInterval

String, currently one of bt, rogers, sbc, verizonpartnerType

User has reached the maximum account sizequotaUsed

Play sound when new emails are receivedsoundNewMail

UserPopPrefMeaningName

User has a POP email accounthasPOP

Whether to import bulk mail (spam)popNoBulk

Whether to add prefix to bulk mail (spam)popBulkSubjectPrefix

UserSendPrefMeaningName

UnknownContactActionaddUnknownContact

String, either "yes" or "no"autosaveOnSend

User can send email from POP account.canSendFromPopAcct

Default address to use for sending messages.defaultFromAddress

Default address to use for sending messages.defaultFromName

Default ID.defaultID

Default address to reply to.defaultReplyToAddress

IncludeMsgOnReplyincludeMsgOnReply

RichTextSignaturerichTextSignature

ShowCcBccshowCcBcc

Whether to add a custom signature to outgoing messages.signatureActive

Text to add as signature to outgoing messages.signatureText

UserSpamPrefMeaningName

User has Spam Guide Plus enabledspamGuardPlusEnabled

User’s spam filter is activespamFilterActive

Spam is moved to inboxspamMoveToInbox

Frequency spam folder is automatically emptiedspamCleanupPeriod

48

Data Types

Page 55: yMailSDK

MeaningName

Mail from blocked addresses sent to spam folderspamBlockSender

UserUIPrefMeaningName

Font Family to use for new messagescomposeFontFamily

Font size to use for new messagescomposeFontSize

Default sort order when listing messagesdefaultSortOrder

Use rich text in message displayuseRichText

String, supporting 0 (don't block), 1 (block all) or 2 (Only from my contacts andCertified senders)

imageBlocking

Show message panemsgPaneVisible

Show a column for the message recipient when viewing folders, for DEA/Address-Guard users only

showTo

String indicating the news category to be displayed on the welcome page. For ex-ample, “topstories”

newsCategory

Boolean indicating whether the calendar strip is on/offshowCalendarStrip

String, indicating if the user should be taken back to the folder (box) or the nextmessage (msg) upon deleting a message

goOnMessageDelete

UserVacationPrefMeaningName

Boolean. Whether to send a vacation response message in reply to incomingmessages.

vacationResponseOn

Text. Body of vacation response message.vacationResponseText

Unix time stamp, as a string. When to start sending vacation response mes-sages.

vacationResponseStartDate

Unix time stamp, as a string. When to stop sending vacation response mes-sages.

vacationResponseEndDate

49

Data Types

Page 56: yMailSDK

Chapter 5. EnumerationsDateType

Identifier

senderDate

receiverDate

FetchStatusIdentifier

success

unknownError

connectionTimeout

badHost

badPort

badUserId

badPassword

badLogin

badFolder

badMailbox

badMessage

lastUnsupported

busy

connectionLost

quota

messageBlocked

largeMsg

GroupByIdentifier

read

unRead

replied

notReplied

flagged

unFlagged

forwarded

50

Page 57: yMailSDK

Identifier

notFowarded

hasAttachment

noAttachment

inAddressBook

notInAddressBook

ImageBlockOption (Security Option)Identifier

none

all

remote

IncludeMsgOnReplyIdentifier

none

short

full

MidLocationResIdentifier

start

center

centerShortL

centerShortR

notFound

na

OffsetTypeIdentifier

startWith

centerOn

51

Enumerations

Page 58: yMailSDK

RichTextSignatureIdentifier

plain

dhtml

plainhtml

SearchAttachmentTypeIdentifier

ignoreattachments

ignoreattachments

anyattachments

SearchDateCheckIdentifier

ignoredate

before

after

on

since

SortKeyIdentifier

date

size

subject

sender

to

recipient

foldeer

SearchMatchModeIdentifier

SearchMatchMode

toonly

allrecipient

52

Enumerations

Page 59: yMailSDK

SortOrderIdentifier

up

down

SearchSizeCheckIdentifier

ignoresize

smaller

larger

eq

SearchRcptModeIdentifier

toonly

allrecipient

SearchTypeIdentifier

body

header

whole

SearchWordBoundsIdentifier

nobounds

whitespaceonly

whitespacepunctuation

ShowCcBccIdentifier

show

hide

53

Enumerations

Page 60: yMailSDK

UseRichTextIdentifier

dynamic

plain

UnknownContactActionIdentifier

always

prompt

unspecified

54

Enumerations