Mail Application Development Platform API Reference

Module: openmail

This JavaScript API for Yahoo! Mail Applications is currently available to application developers. We expect this API list to grow substantially over time.


General Information
  • Many code samples are taken from the "Hello World" and "Saved Searches" applications. These applications can be found in the Application Gallery, where you can add them and view the source code.
  • Very few API calls are synchronous. When data is returned, it's returned through a handler function.
Methods and Response Objects
  • This is the most common signature for API methods:
    errorCode:int APICall(args:object, handler:function)
    

    Note: Some calls don't take arguments, some don't take a handler, and some don't take either.
  • Handlers always have the following signature:
    void handler(response:object)
    
  • The possible members for the response object are listed below. The response object, however, can only have either the error member or the warning member. If an error occurs, the response object will probably not have a data object.
    {
    
    error:int,
    warning:int,
    errorMsg:String,
    errorObj:Object,
    data:Object
    
    }
    • If the call succeeds, error will be absent or ERR_NONE. ERR_NONE is defined as 0, so success is indicated by !error.
    • General error codes are defined in the class openmail. Individual classes can define their own specific error codes.
    • An error code can be returned in warning if the call succeeded but had some issue. Only one of either error or warning can be present. If warning is present, errorMsg and errorObj may be present to provide additional information about the warning.
    • errorMsg is an informational message intended for debugging only.
    • errorObj may contain rich error information defined by the individual method that was called.
    • data contains the data returned by the individual method that was called. If data is present, it is guaranteed to be an object. The members of the object are defined by the individual method called.
    • Additional members can be defined by the method called.
General Error Information
  • The data type for all error codes is int because errors are actually enumerations and not numbers.
  • Only simple errors can be detected and returned synchronously. Expect most errors to be communicated through the handler.
  • Any error which is returned synchronously will also be passed to the handler. The handler will most likely be called before the function returns.
API Versions and Backward Compatability
  • We will strive to maintain backward compatibility. Methods may be extended (an args object may accept additional data, or response.data may return additional information), but calls made against an older version of the API will continue to work.
  • In the cases where we are unable to maintain backward compatibility, deprecated methods will remain in the API but will return ERR_DELETED.
  • You can figure out the API version number by the included JS URL. For example, the version number of the following URL is 0.1.2: http://redirect.corp.yahoo.com/?url=http://mail.yimg.com/a/lib/om/om_api_public/0.1.2/om_api_public.js.

This module contains the following classes:


Copyright © 2009 Yahoo! Inc. All rights reserved.