Packagecom.yahoo.social.methodgroups
Classpublic class YOSMethodBase
InheritanceYOSMethodBase Inheritance flash.events.EventDispatcher
SubclassesApplicationRequest, AuthorizationRequest, ConnectionsRequest, ContactsRequest, ProfileRequest, StatusRequest, UpdatesRequest, YQL

The base class for all YOS API wrappers.



Public Properties
 PropertyDefined by
  consumer : OAuthConsumer
An OAuthConsumer object containing consumer key and secret values.
YOSMethodBase
  token : OAuthToken
An OAuthToken object containing access token key and secret values This value is only used if a user is not defined when signing a request with OAuth.
YOSMethodBase
  user : YahooUser
The user referenced in all data requests.
YOSMethodBase
Protected Properties
 PropertyDefined by
  $consumer : OAuthConsumer
An OAuthConsumer object containing consumer key and secret values.
YOSMethodBase
  $format : String = "json"
The response format to apply to all requests.
YOSMethodBase
  $hostname : String
The hostname to be used in constructing URLs for all requests.
YOSMethodBase
  $oauthRequestType : String
The name of the OAuth request type used for all requests in this class.
YOSMethodBase
  $token : OAuthToken
An OAuthToken object containing access token key and secret values.
YOSMethodBase
  $useExplicitEncoding : Boolean = true
Determines if the request parameters in the signature base string should be encoded using encodeURIComponent when signing the request.
YOSMethodBase
  $user : YahooUser
The YahooUser to reference in all requests.
YOSMethodBase
  $version : String = "v1"
The version of the API.
YOSMethodBase
  OAUTH_HOSTNAME : String = "api.login.yahoo.com"
[static] The hostname for the Yahoo login service (OAuth) API.
YOSMethodBase
  OAUTH_REALM : String = "yahooapis.com"
[static] The name of the OAuth realm for Yahoo! web-services.
YOSMethodBase
Public Methods
 MethodDefined by
  
YOSMethodBase(user:YahooUser = null)
Constructor Creates a new YOSMethodBase object.
YOSMethodBase
Protected Methods
 MethodDefined by
  
decodeJSON(s:String):*
A simple wrapper of the JSON::decode function.
YOSMethodBase
  
encodeJSON(o:Object):String
A simple wrapper of the JSON::encode function.
YOSMethodBase
  
Returns an object containing the required or default request parameters.
YOSMethodBase
  
getResponseStatusOk(status:int):Boolean
Returns true if the status code is 200.
YOSMethodBase
  
handleSecurityError(response:Object):void
Dispatches a SECURITY_ERROR event.
YOSMethodBase
  
sendRequest(httpMethod:String, url:String, callback:Object, args:Object = null, headers:Array = null):void
Signs the request with OAuth credentials then sends the request to the web-service with the supplied callbacks.
YOSMethodBase
Events
 EventSummaryDefined by
   Dispatched when a request fails due to a security error.YOSMethodBase
Protected Constants
 ConstantDefined by
  APPSTORE_WS_HOSTNAME : String = "appstore.apps.yahooapis.com"
[static] The hostname for the Yahoo Application Platform data store.
YOSMethodBase
  SOCIAL_WS_HOSTNAME : String = "social.yahooapis.com"
[static] The hostname for Yahoo Social APIs.
YOSMethodBase
  YQL_HOSTNAME : String = "query.yahooapis.com"
[static] The hostname for the YQL API.
YOSMethodBase
Property detail
$consumerproperty
protected var $consumer:OAuthConsumer

An OAuthConsumer object containing consumer key and secret values.

$formatproperty 
protected var $format:String = "json"

The response format to apply to all requests.

$hostnameproperty 
protected var $hostname:String

The hostname to be used in constructing URLs for all requests.

$oauthRequestTypeproperty 
protected var $oauthRequestType:String

The name of the OAuth request type used for all requests in this class.

$tokenproperty 
protected var $token:OAuthToken

An OAuthToken object containing access token key and secret values.

$useExplicitEncodingproperty 
protected var $useExplicitEncoding:Boolean = true

Determines if the request parameters in the signature base string should be encoded using encodeURIComponent when signing the request.

$userproperty 
protected var $user:YahooUser

The YahooUser to reference in all requests.

$versionproperty 
protected var $version:String = "v1"

The version of the API.

consumerproperty 
consumer:OAuthConsumer  [read-write]

An OAuthConsumer object containing consumer key and secret values. If you wish to make a 2-legged OAuth request, do not pass a YahooUser in the constructor and set this value with your consumer credentials.

Implementation
    public function get consumer():OAuthConsumer
    public function set consumer(value:OAuthConsumer):void

See also

OAuthConsumer
OAUTH_HOSTNAMEproperty 
protected static var OAUTH_HOSTNAME:String = "api.login.yahoo.com"

The hostname for the Yahoo login service (OAuth) API.

OAUTH_REALMproperty 
protected static var OAUTH_REALM:String = "yahooapis.com"

The name of the OAuth realm for Yahoo! web-services.

tokenproperty 
token:OAuthToken  [read-write]

An OAuthToken object containing access token key and secret values This value is only used if a user is not defined when signing a request with OAuth. If you wish to make a 3-legged OAuth request, do not pass a YahooUser in the constructor and set this value with your access token credentials.

Implementation
    public function get token():OAuthToken
    public function set token(value:OAuthToken):void

See also

OAuthToken
userproperty 
user:YahooUser  [read-write]

The user referenced in all data requests.

Implementation
    public function get user():YahooUser
    public function set user(value:YahooUser):void
Constructor detail
YOSMethodBase()constructor
public function YOSMethodBase(user:YahooUser = null)

Constructor Creates a new YOSMethodBase object. This is the base class for all YOS API wrappers.

Parameters
user:YahooUser (default = null)
Method detail
decodeJSON()method
protected function decodeJSON(s:String):*

A simple wrapper of the JSON::decode function.

Parameters
s:String

Returns
*

See also

encodeJSON()method 
protected function encodeJSON(o:Object):String

A simple wrapper of the JSON::encode function.

Parameters
o:Object

Returns
String

See also

getDefaultArguments()method 
protected function getDefaultArguments():Object

Returns an object containing the required or default request parameters.

Returns
Object
getResponseStatusOk()method 
protected function getResponseStatusOk(status:int):Boolean

Returns true if the status code is 200. (AIR-Only) Will also return true if the code is 0 to bypass the browser not providing an http status code.

Parameters
status:int

Returns
Boolean
handleSecurityError()method 
protected function handleSecurityError(response:Object):void

Dispatches a SECURITY_ERROR event.

Parameters
response:Object
sendRequest()method 
protected function sendRequest(httpMethod:String, url:String, callback:Object, args:Object = null, headers:Array = null):void

Signs the request with OAuth credentials then sends the request to the web-service with the supplied callbacks.

Parameters
httpMethod:String
 
url:String
 
callback:Object
 
args:Object (default = null)
 
headers:Array (default = null)
Event detail
securityErrorevent 
Event object type: SecurityErrorEvent

Dispatched when a request fails due to a security error.

Constant detail
APPSTORE_WS_HOSTNAMEconstant
protected static const APPSTORE_WS_HOSTNAME:String = "appstore.apps.yahooapis.com"

The hostname for the Yahoo Application Platform data store.

SOCIAL_WS_HOSTNAMEconstant 
protected static const SOCIAL_WS_HOSTNAME:String = "social.yahooapis.com"

The hostname for Yahoo Social APIs.

YQL_HOSTNAMEconstant 
protected static const YQL_HOSTNAME:String = "query.yahooapis.com"

The hostname for the YQL API.