Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
The OpenSocial JavaScript API includes two namespaces:
opensocial.* and
gadgets.*.
This page covers the opensocial.* namespace.
The gadgets.* namespace is covered in the
Gadgets API Reference.
This document uses the following conventions for types:
Boolean object).String object).Namespace for top-level people functions.
<static>
opensocial.Environment
getEnvironment()
<static>
Boolean
hasPermission(permission)
<static>
opensocial.Activity
newActivity(params)
<static>
opensocial.DataRequest
newDataRequest()
<static>
opensocial.IdSpec
newIdSpec(parameters)
<static>
opensocial.MediaItem
newMediaItem(mimeType, url, opt_params)
<static>
opensocial.Message
newMessage(body, opt_params)
<static>
opensocial.NavigationParameters
newNavigationParameters(parameters)
<static>
requestCreateActivity(activity, priority, opt_callback)
<static>
requestPermission(permissions, reason, opt_callback)
<static>
requestSendMessage(recipients, message, opt_callback, opt_params)
<static>
requestShareApp(recipients, reason, opt_callback, opt_params)
<static> opensocial.Environment getEnvironment()
opensocial.Environment The current environment
<static> Boolean hasPermission(permission)
opensocial.Permission permission - The permission
Boolean True if the gadget has access for the permission; false if it doesn't
<static> opensocial.Activity newActivity(params)
See also: requestCreateActivity(),
It is only required to set one of TITLE_ID or TITLE. In addition, if you are using any variables in your title or title template, you must set TEMPLATE_PARAMS.
Other possible fields to set are: URL, MEDIA_ITEMS, BODY_ID, BODY, EXTERNAL_ID, PRIORITY, STREAM_TITLE, STREAM_URL, STREAM_SOURCE_URL, and STREAM_FAVICON_URL.
Containers are only required to use TITLE_ID or TITLE, and may choose to ignore additional parameters.
See Field for more details.
Map.<opensocial.Activity.Field, Object> params - Parameters defining the activity
opensocial.Activity The new
activity object
<static> opensocial.DataRequest newDataRequest()
opensocial.DataRequest The
request object
<static> opensocial.IdSpec newIdSpec(parameters)
Map.<opensocial.IdSpec.Field, Object> parameters - Parameters defining the id spec
opensocial.IdSpec The new
IdSpec object
<static> opensocial.MediaItem newMediaItem(mimeType, url, opt_params)
String mimeType - MIME type of the
media
String url - Where the media can be found
Map.<opensocial.MediaItem.Field, Object> opt_params - Any other fields that should be set on the media item object;
all of the defined
Fields
are supported
opensocial.MediaItem The new
media item object
<static> opensocial.Message newMessage(body, opt_params)
String body - The main text of the message
Map.<opensocial.Message.Field, Object> opt_params - Any other fields that should be set on the message object;
all of the defined
Fields
are supported
opensocial.Message The new
message object
<static> opensocial.NavigationParameters newNavigationParameters(parameters)
See also: requestShareApp()
Map.<opensocial.NavigationParameters.Field, Object> parameters - Parameters defining the navigation
opensocial.NavigationParameters The new
NavigationParameters
object
<static> requestCreateActivity(activity, priority, opt_callback)
See also: newActivity()
Note: If this is the first activity that has been created for the user and the request is marked as HIGH priority then this call may open a user flow and navigate away from your gadget.
This callback will either be called or the gadget will be reloaded from scratch. This function will be passed one parameter, an opensocial.ResponseItem. The error code will be set to reflect whether there were any problems with the request. If there was no error, the activity was created. If there was an error, you can use the response item's getErrorCode method to determine how to proceed. The data on the response item will not be set.
If the container does not support this method the callback will be called with a opensocial.ResponseItem. The response item will have its error code set to NOT_IMPLEMENTED.
opensocial.Activity activity - The
activity to create
opensocial.CreateActivityPriority priority - The
priority for this
request
Function opt_callback - The function to call once the request has been
processed.
<static> requestPermission(permissions, reason, opt_callback)
Array.<opensocial.Permission> permissions - The permissions to request
from the viewer
String reason - Displayed to the user as the reason why these
permissions are needed
Function opt_callback - The function to call once the request has been
processed; either this callback will be called or the gadget will be
reloaded from scratch. This function will be passed one parameter, an
opensocial.ResponseItem. The error code will be set to reflect whether
there were any problems with the request. If there was no error, all
permissions were granted. If there was an error, you can use
opensocial.hasPermission to check which permissions are still denied. The
data on the response item will be set. It will be an array of the
opensocial.Permissions that were granted.
<static> requestSendMessage(recipients, message, opt_callback, opt_params)
The callback function is passed one parameter, an opensocial.ResponseItem. The error code will be set to reflect whether there were any problems with the request. If there was no error, the message was sent. If there was an error, you can use the response item's getErrorCode method to determine how to proceed. The data on the response item will not be set.
If the container does not support this method the callback will be called with an opensocial.ResponseItem that has an error code of NOT_IMPLEMENTED.
Array.<String>, String recipients - An ID, array of IDs, or a
group reference; the supported keys are VIEWER, OWNER, VIEWER_FRIENDS,
OWNER_FRIENDS, or a single ID within one of those groups
opensocial.Message message - The message to send to the specified
users
Function opt_callback - The function to call once the request has been
processed; either this callback will be called or the gadget will be
reloaded from scratch
opensocial.NavigationParameters opt_params - The optional parameters
indicating where to send a user when a request is made, or when a request is
accepted; options are of type
NavigationParameters.DestinationType
<static> requestShareApp(recipients, reason, opt_callback, opt_params)
The callback function is passed one parameter, an opensocial.ResponseItem. The error code will be set to reflect whether there were any problems with the request. If there was no error, the sharing request was sent. If there was an error, you can use the response item's getErrorCode method to determine how to proceed. The data on the response item will not be set.
If the container does not support this method the callback will be called with a opensocial.ResponseItem. The response item will have its error code set to NOT_IMPLEMENTED.
Array.<String>, String recipients - An ID, array of IDs, or a
group reference; the supported keys are VIEWER, OWNER, VIEWER_FRIENDS,
OWNER_FRIENDS, or a single ID within one of those groups
opensocial.Message reason - The reason the user wants the gadget to
share itself. This reason can be used by the container when prompting the
user for permission to share the app. It may also be ignored.
Function opt_callback - The function to call once the request has been
processed; either this callback will be called or the gadget will be
reloaded from scratch
opensocial.NavigationParameters opt_params - The optional parameters
indicating where to send a user when a request is made, or when a request is
accepted; options are of type
NavigationParameters.DestinationType
Representation of an activity.
Activities are rendered with a title and an optional activity body.
You may set the title and body directly as strings when calling opensocial.newActivity. However, it is usually beneficial to create activities using Message Templates for the title and body.
Users will have many activities in their activity streams, and containers will not show every activity that is visible to a user. To help display large numbers of activities, containers will summarize a list of activities from a given source to a single entry.
You can provide Activity Summaries to customize the text shown when multiple activities are summarized. If no customization is provided, a container may ignore your activities altogether or provide default text such as "Bob changed his status message + 20 other events like this."
Example summaries:
<messagebundle>
<msg name="LISTEN_TO_THIS_SONG:Artist">
${Subject.Count} of your friends have suggested listening to songs
by ${Artist}!
</msg>
<msg name="LISTEN_TO_THIS_SONG:Song">
${Subject.Count} of your friends have suggested listening to ${Song}
!</msg>
<msg name="LISTEN_TO_THIS_SONG:Subject">
${Subject.DisplayName} has recommended ${Song.Count} songs to you.
</msg>
</messagebundle>
See also: opensocial.Message, opensocial.newActivity(), opensocial.requestCreateActivity()
String
getField(key, opt_params)
String
getId()
setField(key, data)
String getField(key, opt_params)
String key - The key to get data for;
see the Field class
for possible values
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
String getId()
String The ID
setField(key, data)
String key - The key to set data for
String data - The data to set
All of the fields that activities can have.
It is only required to set one of TITLE_ID or TITLE. In addition, if you are using any variables in your title or title template, you must set TEMPLATE_PARAMS.
Other possible fields to set are: URL, MEDIA_ITEMS, BODY_ID, BODY, EXTERNAL_ID, PRIORITY, STREAM_TITLE, STREAM_URL, STREAM_SOURCE_URL, and STREAM_FAVICON_URL.
Containers are only required to use TITLE_ID or TITLE, they may ignore additional parameters.
See also: opensocial.Activity.getField()
<static> object
APP_ID
<static> object
BODY
A string specifying an optional expanded version of an activity.
<static> object
BODY_ID
A string specifying the body template message ID in the gadget spec.
<static> object
EXTERNAL_ID
<static> object
ID
<static> object
MEDIA_ITEMS
<static> object
POSTED_TIME
<static> object
PRIORITY
<static> object
STREAM_FAVICON_URL
<static> object
STREAM_SOURCE_URL
<static> object
STREAM_TITLE
<static> object
STREAM_URL
<static> object
TEMPLATE_PARAMS
A map of custom key/value pairs associated with this activity.
<static> object
TITLE
A string specifying the primary text of an activity.
<static> object
TITLE_ID
A string specifying the title template message ID in the gadget spec.
<static> object
URL
<static> object
USER_ID
<static> object APP_ID
<static> object BODY
A string specifying an optional expanded version of an activity.
Bodies may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.
<static> object BODY_ID
A string specifying the body template message ID in the gadget spec.
The body is an optional expanded version of an activity.
Bodies may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.
<static> object EXTERNAL_ID
<static> object ID
<static> object MEDIA_ITEMS
Array<
MediaItem>.
<static> object POSTED_TIME
<static> object PRIORITY
<static> object STREAM_FAVICON_URL
<static> object STREAM_SOURCE_URL
<static> object STREAM_TITLE
<static> object STREAM_URL
<static> object TEMPLATE_PARAMS
A map of custom key/value pairs associated with this activity. These will be used for evaluation in templates.
The data has type Map<String, Object>. The
object may be either a String or an opensocial.Person.
When passing in a person with key PersonKey, can use the following replacement variables in the template:
<static> object TITLE
A string specifying the primary text of an activity.
Titles may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.
<static> object TITLE_ID
A string specifying the title template message ID in the gadget spec.
The title is the primary text of an activity.
Titles may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.
<static> object URL
<static> object USER_ID
Base interface for all address objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Address.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request
String The data
All of the fields that an address has. These are the supported keys for the Address.getField() method.
<static> object
COUNTRY
<static> object
EXTENDED_ADDRESS
<static> object
LATITUDE
<static> object
LOCALITY
<static> object
LONGITUDE
<static> object
PO_BOX
<static> object
POSTAL_CODE
<static> object
REGION
<static> object
STREET_ADDRESS
<static> object
TYPE
<static> object
UNSTRUCTURED_ADDRESS
<static> object COUNTRY
<static> object EXTENDED_ADDRESS
<static> object LATITUDE
<static> object LOCALITY
<static> object LONGITUDE
<static> object PO_BOX
<static> object POSTAL_CODE
<static> object REGION
<static> object STREET_ADDRESS
<static> object TYPE
<static> object UNSTRUCTURED_ADDRESS
Base interface for all body type objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
BodyType.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
All of the fields that a body type has. These are the supported keys for the BodyType.getField() method.
<static> object
BUILD
<static> object
EYE_COLOR
<static> object
HAIR_COLOR
<static> object
HEIGHT
<static> object
WEIGHT
<static> object BUILD
<static> object EYE_COLOR
<static> object HAIR_COLOR
<static> object HEIGHT
<static> object WEIGHT
Collection of multiple objects with useful accessors. May also represent subset of a larger collection (for example, page 1 of 10) and contain information about the larger collection.
Array.<Object>
asArray()
each(fn)
Object?
getById(id)
Number
getOffset()
Number
getTotalSize()
Number
size()
Array.<Object> asArray()
Array.<Object> The values in this collection
each(fn)
Function fn - The function to call with each collection entry
Object? getById(id)
String id - The ID to look for
Object? The data
Number getOffset()
Number The offset into the total collection
Number getTotalSize()
Number The total size of the result
Number size()
Number The size of this collection
The priorities a create activity request can have.
See also: opensocial.requestCreateActivity()
<static> object
HIGH
<static> object
LOW
<static> object HIGH
<static> object LOW
Used to request social information from the container. This includes data for friends, profiles, app data, and activities. All apps that require access to people information should send a DataRequest.
Here's an example of creating, initializing, sending, and handling the results of a data request:
function requestMe() {
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(
opensocial.IdSpec.PersonId.VIEWER),
"viewer");
req.send(handleRequestMe);
};
function handleRequestMe(data) {
var viewer = data.get("viewer");
if (viewer.hadError()) {
//Handle error using viewer.getError()...
return;
}
//No error. Do something with viewer.getData()...
}
See also:
opensocial.newDataRequest()
add(request, opt_key)
Object
newFetchActivitiesRequest(idSpec, opt_params)
Object
newFetchPeopleRequest(idSpec, opt_params)
Object
newFetchPersonAppDataRequest(idSpec, keys, opt_params)
Object
newFetchPersonRequest(id, opt_params)
Object
newRemovePersonAppDataRequest(id, keys)
Object
newUpdatePersonAppDataRequest(id, key, value)
send(opt_callback)
add(request, opt_key)
Object request - Specifies which data to fetch or update
String opt_key - A key to map the generated response data to
Object newFetchActivitiesRequest(idSpec, opt_params)
When processed, returns a Collection<Activity>.
opensocial.IdSpec idSpec - An IdSpec used to specify
which people to fetch. See also IdSpec.
Map.<opensocial.DataRequest.ActivityRequestFields, Object> opt_params - Additional parameters
to pass to the request; not currently used
Object A request object
Object newFetchPeopleRequest(idSpec, opt_params)
opensocial.IdSpec idSpec - An IdSpec used to specify
which people to fetch. See also IdSpec.
Map.<opensocial.DataRequest.PeopleRequestFields, Object> opt_params - Additional
params
to pass to the request
Object A request object
Object newFetchPersonAppDataRequest(idSpec, keys, opt_params)
opensocial.IdSpec idSpec - An IdSpec used to specify
which people to fetch. See also IdSpec.
Array.<String>, String keys - The keys you want data for; this
can be an array of key names, a single key name, or "*" to mean
"all keys"
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request
Object A request object
Object newFetchPersonRequest(id, opt_params)
Person object.
String id - The ID of the person to fetch; can be the standard
person ID
of VIEWER or OWNER
Map.<opensocial.DataRequest.PeopleRequestFields, Object> opt_params - Additional
parameters
to pass to the request; this request supports PROFILE_DETAILS
Object A request object
Object newRemovePersonAppDataRequest(id, keys)
String id - The ID of the person to update; only the
special VIEWER ID is currently allowed.
Array.<String>, String keys - The keys you want to delete from
the datastore; this can be an array of key names, a single key name,
or "*" to mean "all keys"
Object A request object
Object newUpdatePersonAppDataRequest(id, key, value)
String id - The ID of the person to update; only the
special VIEWER ID is currently allowed.
String key - The name of the key. This may only contain alphanumeric
(A-Za-z0-9) characters, underscore(_), dot(.) or dash(-).
Object value - The value, must be valid json
Object A request object
send(opt_callback)
Function opt_callback - The function to call with the
data response
generated by the server
<static> object
ESCAPE_TYPE
<static> object ESCAPE_TYPE
The filters available for limiting person requests.
<static> object
ALL
<static> object
HAS_APP
<static> object
TOP_FRIENDS
<static> object ALL
<static> object HAS_APP
<static> object TOP_FRIENDS
<static> object
FILTER
<static> object
FILTER_OPTIONS
<static> object
FIRST
<static> object
MAX
<static> object
PROFILE_DETAILS
opensocial.Person.Field
specifying what profile data to fetch
for each of the person objects.
<static> object
SORT_ORDER
<static> object FILTER
<static> object FILTER_OPTIONS
<static> object FIRST
<static> object MAX
<static> object PROFILE_DETAILS
opensocial.Person.Field
specifying what profile data to fetch
for each of the person objects. The server will always include
ID, NAME, and THUMBNAIL_URL.
<static> object SORT_ORDER
The sort orders available for ordering person objects.
<static> object
NAME
<static> object
TOP_FRIENDS
<static> object NAME
<static> object TOP_FRIENDS
This object contains the requested server data mapped to the requested keys.
See also: DataRequest
opensocial.ResponseItem
get(key)
String
getErrorMessage()
Boolean
hadError()
opensocial.ResponseItem get(key)
key
opensocial.ResponseItem The requested
response calculated by the
server
String getErrorMessage()
String A human-readable description of the error that occurred.
Boolean hadError()
Boolean True if there was an error; otherwise, false
Base interface for all email objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Email.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
All of the fields that an email has. These are the supported keys for the Email.getField() method.
<static> object
ADDRESS
<static> object
TYPE
<static> object ADDRESS
<static> object TYPE
Base interface for all enum objects. This class allows containers to use constants for fields that are usually have a common set of values. There are two main ways to use this class.
If your gadget just wants to display how much of a smoker someone is, it can simply use:
html = "This person smokes: " + person.getField('smoker').getValue();
This value field will be correctly set up by the container. This is a place where the container can even localize the value for the gadget so that it always shows the right thing.
If your gadget wants to have some logic around the smoker field it can use:
if (person.getField('smoker').getKey() != "NO") { //gadget logic here }
Note: The key may be null if the person's smoker field cannot be coerced into one of the standard enum types. The value, on the other hand, is never null.
String
getDisplayValue()
String
getKey()
String getDisplayValue()
String The enum's value.
String getKey()
String The enum's key. This should be one of the defined enums
below.
The enum keys used by the drinker field.
See also: opensocial.Person.Field.Drinker
<static> object
HEAVILY
<static> object
NO
<static> object
OCCASIONALLY
<static> object
QUIT
<static> object
QUITTING
<static> object
REGULARLY
<static> object
SOCIALLY
<static> object
YES
<static> object HEAVILY
<static> object NO
<static> object OCCASIONALLY
<static> object QUIT
<static> object QUITTING
<static> object REGULARLY
<static> object SOCIALLY
<static> object YES
The enum keys used by the gender field.
See also: opensocial.Person.Field.Gender
<static> object FEMALE
<static> object MALE
The enum keys used by the lookingFor field.
See also: opensocial.Person.Field.LookingFor
<static> object
ACTIVITY_PARTNERS
<static> object
DATING
<static> object
FRIENDS
<static> object
NETWORKING
<static> object
RANDOM
<static> object
RELATIONSHIP
<static> object ACTIVITY_PARTNERS
<static> object DATING
<static> object FRIENDS
<static> object NETWORKING
<static> object RANDOM
<static> object RELATIONSHIP
The enum keys used by the networkPresence field.
See also: opensocial.Person.Field.NetworkPresence
<static> object
AWAY
<static> object
CHAT
<static> object
DND
<static> object
OFFLINE
<static> object
ONLINE
<static> object
XA
<static> object AWAY
<static> object CHAT
<static> object DND
<static> object OFFLINE
<static> object ONLINE
<static> object XA
The enum keys used by the smoker field.
See also: opensocial.Person.Field.Smoker
<static> object
HEAVILY
<static> object
NO
<static> object
OCCASIONALLY
<static> object
QUIT
<static> object
QUITTING
<static> object
REGULARLY
<static> object
SOCIALLY
<static> object
YES
<static> object HEAVILY
<static> object NO
<static> object OCCASIONALLY
<static> object QUIT
<static> object QUITTING
<static> object REGULARLY
<static> object SOCIALLY
<static> object YES
Represents the current environment for a gadget.
See also: opensocial.getEnvironment(),
String
getDomain()
Boolean
supportsField(objectType, fieldName)
String getDomain()
String The domain
Boolean supportsField(objectType, fieldName)
opensocial.Environment.ObjectType objectType - The object type
to check for the field
String fieldName - The name of the field to check for
Boolean True if the field is supported on the specified object type
The types of objects in this container.
See also:
Environment.supportsField()
<static> object
ACTIVITY
<static> object
ADDRESS
<static> object
BODY_TYPE
<static> object
EMAIL
<static> object
FILTER_TYPE
<static> object
MEDIA_ITEM
<static> object
MESSAGE
<static> object
MESSAGE_TYPE
<static> object
NAME
<static> object
ORGANIZATION
<static> object
PERSON
<static> object
PHONE
<static> object
SORT_ORDER
<static> object
URL
<static> object ACTIVITY
<static> object ADDRESS
<static> object BODY_TYPE
<static> object EMAIL
<static> object FILTER_TYPE
<static> object MEDIA_ITEM
<static> object MESSAGE
<static> object MESSAGE_TYPE
<static> object NAME
<static> object ORGANIZATION
<static> object PERSON
<static> object PHONE
<static> object SORT_ORDER
<static> object URL
The types of escaping that can be applied to person data or fields.
<static> object
HTML_ESCAPE
<static> object
NONE
<static> object HTML_ESCAPE
<static> object NONE
Base interface for all id spec objects.
String
getField(key, opt_params)
setField(key, data)
String getField(key, opt_params)
String key - The key to get data for;
see the Field class
for possible values
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
setField(key, data)
String key - The key to set data for
String data - The data to set
All of the fields that id specs can have.
See also: opensocial.IdSpec.getField()
<static> object
GROUP_ID
<static> object
NETWORK_DISTANCE
<static> object
USER_ID
<static> object GROUP_ID
<static> object NETWORK_DISTANCE
<static> object USER_ID
Constant person IDs available when fetching person information.
<static> object OWNER
<static> object VIEWER
Represents images, movies, and audio.
Create a MediaItem object using the
opensocial.newMediaItem() method.
String
getField(key, opt_params)
setField(key, data)
String getField(key, opt_params)
String key - The key to get data for; see the
Field class
for possible values
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
setField(key, data)
String key - The key to set data for
String data - The data to set
All of the fields that media items have.
See also: opensocial.MediaItem.getField()
<static> object
MIME_TYPE
<static> object
TYPE
MediaItem.Type object.
<static> object
URL
<static> object MIME_TYPE
<static> object TYPE
MediaItem.Type object.
<static> object URL
The possible types of media items.
See also: opensocial.MediaItem.Field
<static> object AUDIO
<static> object IMAGE
<static> object VIDEO
Base interface for all message objects. *
See also: opensocial.newMessage(), opensocial.requestSendMessage()
String
getField(key, opt_params)
setField(key, data)
String getField(key, opt_params)
String key - The key to get data for;
see the Field class
for possible values
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
setField(key, data)
String key - The key to set data for
String data - The data to set
All of the fields that messages can have.
See also: opensocial.Message.getField()
<static> object
BODY
<static> object
BODY_ID
<static> object
TITLE
<static> object
TITLE_ID
<static> object
TYPE
<static> object BODY
<static> object BODY_ID
<static> object TITLE
<static> object TITLE_ID
<static> object TYPE
The types of messages that can be sent.
<static> object
EMAIL
<static> object
NOTIFICATION
<static> object
PRIVATE_MESSAGE
<static> object
PUBLIC_MESSAGE
<static> object EMAIL
<static> object NOTIFICATION
<static> object PRIVATE_MESSAGE
<static> object PUBLIC_MESSAGE
Base interface for all name objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Name.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
All of the fields that a name has. These are the supported keys for the Name.getField() method.
<static> object
ADDITIONAL_NAME
<static> object
FAMILY_NAME
<static> object
GIVEN_NAME
<static> object
HONORIFIC_PREFIX
<static> object
HONORIFIC_SUFFIX
<static> object
UNSTRUCTURED
<static> object ADDITIONAL_NAME
<static> object FAMILY_NAME
<static> object GIVEN_NAME
<static> object HONORIFIC_PREFIX
<static> object HONORIFIC_SUFFIX
<static> object UNSTRUCTURED
Parameters used by RequestShareApp to instruct the container on where to go after the request is made. It could be used, for example, to specify where viewers get routed in one of two cases: 1) After a user gets a shareApp invitation or receives a message a gadget developer should be able to send that user to a context sensitive place. 2) After a viewer actually shares an app with someone else the gadget developer should be able to redirect the viewer to a context sensitive place.
String
getField(key, opt_params)
setField(key, data)
String getField(key, opt_params)
String key - The key to get data for;
see the Field class
for possible values
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
setField(key, data)
String key - The key to set data for
Object data - The data to set
The destinations available for navigation in requestShareApp and requestSendMessage.
<static> object
RECIPIENT_DESTINATION
<static> object
VIEWER_DESTINATION
<static> object RECIPIENT_DESTINATION
<static> object VIEWER_DESTINATION
All of the fields that NavigationParameters can have.
See also: opensocial.NavigationParameters.getField()
<static> object
OWNER
<static> object
PARAMETERS
<static> object
VIEW
<static> object OWNER
<static> object PARAMETERS
<static> object VIEW
Base interface for all organization objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Organization.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request
String The data
All of the fields that a organization has. These are the supported keys for the Organization.getField() method.
<static> object
ADDRESS
<static> object
DESCRIPTION
<static> object
END_DATE
<static> object
FIELD
<static> object
NAME
<static> object
SALARY
<static> object
START_DATE
<static> object
SUB_FIELD
<static> object
TITLE
<static> object
WEBPAGE
<static> object ADDRESS
<static> object DESCRIPTION
<static> object END_DATE
<static> object FIELD
<static> object NAME
<static> object SALARY
<static> object START_DATE
<static> object SUB_FIELD
<static> object TITLE
<static> object WEBPAGE
The permissions an app can ask for.
See also:
opensocial.hasPermission(),
opensocial.requestPermission()
<static> object
VIEWER
<static> object VIEWER
Base interface for all person objects.
String
getDisplayName()
String
getField(key, opt_params)
String
getId()
Boolean
isOwner()
Boolean
isViewer()
String getDisplayName()
String The display name
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Person.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
String getId()
String The ID
Boolean isOwner()
Boolean True if this is the owner of the page;
otherwise, false
Boolean isViewer()
Boolean True if this is the currently logged in user;
otherwise, false
All of the fields that a person has. These are the supported keys for the Person.getField() method.
<static> object
ABOUT_ME
<static> object
ACTIVITIES
<static> object
ADDRESSES
<static> object
AGE
<static> object
BODY_TYPE
<static> object
BOOKS
<static> object
CARS
<static> object
CHILDREN
<static> object
CURRENT_LOCATION
<static> object
DATE_OF_BIRTH
<static> object
DRINKER
<static> object
EMAILS
<static> object
ETHNICITY
<static> object
FASHION
<static> object
FOOD
<static> object
GENDER
<static> object
HAPPIEST_WHEN
<static> object
HAS_APP
<static> object
HEROES
<static> object
HUMOR
<static> object
ID
<static> object
INTERESTS
<static> object
JOB_INTERESTS
<static> object
JOBS
<static> object
LANGUAGES_SPOKEN
<static> object
LIVING_ARRANGEMENT
<static> object
LOOKING_FOR
<static> object
MOVIES
<static> object
MUSIC
<static> object
NAME
<static> object
NETWORK_PRESENCE
<static> object
NICKNAME
<static> object
PETS
<static> object
PHONE_NUMBERS
<static> object
POLITICAL_VIEWS
<static> object
PROFILE_SONG
<static> object
PROFILE_URL
<static> object
PROFILE_VIDEO
<static> object
QUOTES
<static> object
RELATIONSHIP_STATUS
<static> object
RELIGION
<static> object
ROMANCE
<static> object
SCARED_OF
<static> object
SCHOOLS
<static> object
SEXUAL_ORIENTATION
<static> object
SMOKER
<static> object
SPORTS
<static> object
STATUS
<static> object
TAGS
<static> object
THUMBNAIL_URL
<static> object
TIME_ZONE
<static> object
TURN_OFFS
<static> object
TURN_ONS
<static> object
TV_SHOWS
<static> object
URLS
<static> object ABOUT_ME
<static> object ACTIVITIES
<static> object ADDRESSES
<static> object AGE
<static> object BODY_TYPE
<static> object BOOKS
<static> object CARS
<static> object CHILDREN
<static> object CURRENT_LOCATION
<static> object DATE_OF_BIRTH
<static> object DRINKER
<static> object EMAILS
<static> object ETHNICITY
<static> object FASHION
<static> object FOOD
<static> object GENDER
<static> object HAPPIEST_WHEN
<static> object HAS_APP
<static> object HEROES
<static> object HUMOR
<static> object ID
<static> object INTERESTS
<static> object JOB_INTERESTS
<static> object JOBS
<static> object LANGUAGES_SPOKEN
<static> object LIVING_ARRANGEMENT
<static> object LOOKING_FOR
<static> object MOVIES
<static> object MUSIC
<static> object NAME
<static> object NETWORK_PRESENCE
<static> object NICKNAME
<static> object PETS
<static> object PHONE_NUMBERS
<static> object POLITICAL_VIEWS
<static> object PROFILE_SONG
<static> object PROFILE_URL
<static> object PROFILE_VIDEO
<static> object QUOTES
<static> object RELATIONSHIP_STATUS
<static> object RELIGION
<static> object ROMANCE
<static> object SCARED_OF
<static> object SCHOOLS
<static> object SEXUAL_ORIENTATION
<static> object SMOKER
<static> object SPORTS
<static> object STATUS
<static> object TAGS
<static> object THUMBNAIL_URL
<static> object TIME_ZONE
<static> object TURN_OFFS
<static> object TURN_ONS
<static> object TV_SHOWS
<static> object URLS
Base interface for all phone objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Phone.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
All of the fields that a phone has. These are the supported keys for the Phone.getField() method.
<static> object
NUMBER
<static> object
TYPE
<static> object NUMBER
<static> object TYPE
Represents a response that was generated by processing a data request item on the server.
Object
getData()
String
getErrorCode()
String
getErrorMessage()
opensocial.DataRequest
getOriginalDataRequest()
Boolean
hadError()
Object getData()
Object The requested value calculated by the server; the type of
this value is defined by the type of request that was made
String getErrorCode()
Error.
String The error code, or null if no error occurred
String getErrorMessage()
String A human-readable description of the error that occurred;
can be null, even if an error occurred
opensocial.DataRequest getOriginalDataRequest()
opensocial.DataRequest The data request used to fetch this data
response
Boolean hadError()
Boolean True if there was an error; otherwise, false
Error codes that a response item can return.
<static> object
BAD_REQUEST
<static> object
FORBIDDEN
<static> object
INTERNAL_ERROR
<static> object
LIMIT_EXCEEDED
<static> object
NOT_IMPLEMENTED
<static> object
UNAUTHORIZED
<static> object BAD_REQUEST
<static> object FORBIDDEN
<static> object INTERNAL_ERROR
<static> object LIMIT_EXCEEDED
<static> object NOT_IMPLEMENTED
<static> object UNAUTHORIZED
Base interface for all URL objects.
String
getField(key, opt_params)
String getField(key, opt_params)
String key - The key to get data for;
keys are defined in
Url.Field
Map.<opensocial.DataRequest.DataRequestFields, Object> opt_params - Additional
params
to pass to the request.
String The data
All of the fields that a URL has. These are the supported keys for the Url.getField() method.
<static> object
ADDRESS
<static> object
LINK_TEXT
<static> object
TYPE
<static> object ADDRESS
<static> object LINK_TEXT
<static> object TYPE