OpenSocial API Reference V 8.0

Reviews
Shared by: Tara Sims
Stats
views:
117
rating:
not rated
reviews:
0
posted:
8/9/2008
language:
English
pages:
0
OpenSocial API Reference (v0.8) 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. Contents   Type Conventions opensocial o Activity  Field o Address  Field o BodyType  Field o Collection o CreateActivityPriority o DataRequest  DataRequestFields  FilterType  PeopleRequestFields  SortOrder o DataResponse o Email  Field o Enum  Drinker  Gender  LookingFor  Presence  Smoker o Environment  ObjectType o EscapeType o IdSpec  Field  PersonId o MediaItem  Field  Type o Message  Field  Type o Name  Field o NavigationParameters  DestinationType  Field o Organization  Field o o Permission Person  Field o Phone  Field o ResponseItem  Error o Url  Field Back to top Type Conventions This document uses the following conventions for types: Array or Array. An Array filled with only objects of type T. This convention is similar to Java generics. Map or Map. A JavaScript object with keys of type K that map to values of type V. Again, this convention is similar to Java generics. It's often used for opt_params variables. static A type marked with static class has no public or private constructor. In other words, the type is a namespace, not a class that can be instantiated to create objects. The fields and functions in such a type are also marked as static. Boolean A boolean value (not a Boolean object). String A string value (not a String object). Back to top Static Class opensocial SUMMARY DETAIL Namespace for top-level people functions. Method Summary opensocial.Environment getEnvironment() Boolean hasPermission(permission) opensocial.Activity newActivity(params) opensocial.DataRequest newDataRequest() opensocial.IdSpec newIdSpec(parameters) Gets the current environment for this gadget. Returns true if the current gadget has access to the specified permission. Creates an activity object, which represents an activity on the server. Creates a data request object to use for sending and fetching data from the server. Creates an IdSpec object. opensocial.MediaItem newMediaItem(mimeType, url, opt_params) opensocial.Message newMessage(body, opt_params) opensocial.NavigationParameters newNavigationParameters(parameters) Creates a media item. Creates a media item associated with an activity. Creates a NavigationParameters object. requestCreateActivity(activity, priority, opt_callback) Takes an activity and tries to create it, without waiting for the operation to complete. requestPermission(permissions, reason, opt_callback) Requests the user to grant access to the specified permissions. requestSendMessage(recipients, message, opt_callback, opt_params) Requests the container to send a specific message to the specified users. requestShareApp(recipients, reason, opt_callback, opt_params) Requests the container to share this gadget with the specified users. Method Detail getEnvironment opensocial.Environment getEnvironment() Gets the current environment for this gadget. You can use the environment to make queries such as what profile fields and surfaces are supported by this container, what parameters were passed to the current gadget, and so on. Returns: opensocial.Environment The current environment hasPermission Boolean hasPermission(permission) Returns true if the current gadget has access to the specified permission. If the gadget calls opensocial.requestPermission and permissions are granted then this function must return true on all subsequent calls. Parameters: opensocial.Permission permission - The permission Returns: Boolean True if the gadget has access for the permission; false if it doesn't newActivity opensocial.Activity newActivity(params) Creates an activity object, which represents an activity on the server. 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. Parameters: Map. params - Parameters defining the activity Returns: opensocial.Activity The new activity object newDataRequest opensocial.DataRequest newDataRequest() Creates a data request object to use for sending and fetching data from the server. Returns: opensocial.DataRequest The request object newIdSpec opensocial.IdSpec newIdSpec(parameters) Creates an IdSpec object. Parameters: Map. parameters - Parameters defining the id spec Returns: opensocial.IdSpec The new IdSpec object newMediaItem opensocial.MediaItem newMediaItem(mimeType, url, opt_params) Creates a media item. Represents images, movies, and audio. Used when creating activities on the server. Parameters: String mimeType - MIME type of the media String url - Where the media can be found Map. opt_params - Any other fields that should be set on the media item object; all of the defined Fields are supported Returns: opensocial.MediaItem The new media item object newMessage opensocial.Message newMessage(body, opt_params) Creates a media item associated with an activity. Represents images, movies, and audio. Used when creating activities on the server. Parameters: String body - The main text of the message Map. opt_params - Any other fields that should be set on the message object; all of the defined Fields are supported Returns: opensocial.Message The new message object newNavigationParameters opensocial.NavigationParameters newNavigationParameters(parameters) Creates a NavigationParameters object. See also: requestShareApp() Parameters: Map. parameters - Parameters defining the navigation Returns: opensocial.NavigationParameters The new NavigationParameters object requestCreateActivity requestCreateActivity(activity, priority, opt_callback) Takes an activity and tries to create it, without waiting for the operation to complete. Optionally calls a function when the operation completes. 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. Parameters: 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. requestPermission requestPermission(permissions, reason, opt_callback) Requests the user to grant access to the specified permissions. 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. Parameters: Array. 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. requestSendMessage requestSendMessage(recipients, message, opt_callback, opt_params) Requests the container to send a specific message to the specified users. 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. Parameters: Array., 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 requestShareApp requestShareApp(recipients, reason, opt_callback, opt_params) Requests the container to share this gadget with the specified users. 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. Parameters: Array., 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 Back to top Class opensocial.Activity SUMMARY DETAIL 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."    Activity Summaries will always summarize around a specific key in a key/value pair. This is so that the summary can say something concrete (this is clearer in the example below). Other variables will have synthetic "Count" variables created with the total number of items summarized. Message ID of the summary is the message ID of the main template + ":" + the data key Example summaries: ${Subject.Count} of your friends have suggested listening to songs by ${Artist}! ${Subject.Count} of your friends have suggested listening to ${Song} ! ${Subject.DisplayName} has recommended ${Song.Count} songs to you. See also: opensocial.Message, opensocial.newActivity(), opensocial.requestCreateActivity() Method Summary String getField(key, opt_params) Gets the activity data that's associated with the specified key. String getId() Gets an ID that can be permanently associated with this activity. setField(key, data) Sets data for this activity associated with the given key. Method Detail getField String getField(key, opt_params) Gets the activity data that's associated with the specified key. Parameters: String key - The key to get data for; see the Field class for possible values Map. opt_params - Additional params to pass to the request. Returns: String The data getId String getId() Gets an ID that can be permanently associated with this activity. Returns: String The ID setField setField(key, data) Sets data for this activity associated with the given key. Parameters: String key - The key to set data for String data - The data to set Back to top Static Class opensocial.Activity.Field SUMMARY DETAIL 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() Field Summary object APP_ID A string specifying the application that this activity is associated with. object BODY A string specifying an optional expanded version of an activity. object BODY_ID A string specifying the body template message ID in the gadget spec. object EXTERNAL_ID An optional string ID generated by the posting application. object ID A string ID that is permanently associated with this activity. object MEDIA_ITEMS Any photos, videos, or images that should be associated with the activity. object POSTED_TIME A string specifying the time at which this activity took place in milliseconds since the epoch. object PRIORITY A number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source object STREAM_FAVICON_URL A string specifying the URL for the stream's favicon. object STREAM_SOURCE_URL A string specifying the stream's source URL. object STREAM_TITLE A string specifing the title of the stream. object STREAM_URL A string specifying the stream's URL. object TEMPLATE_PARAMS A map of custom key/value pairs associated with this activity. object TITLE A string specifying the primary text of an activity. object TITLE_ID A string specifying the title template message ID in the gadget spec. object URL A string specifying the URL that represents this activity. object USER_ID The string ID of the user who this activity is for. Field Detail APP_ID object APP_ID A string specifying the application that this activity is associated with. This value can not be set. BODY object BODY A string specifying an optional expanded version of an activity. Bodies may only have the following HTML tags: , , . The container may ignore this formatting when rendering the activity. BODY_ID 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: , , . The container may ignore this formatting when rendering the activity. EXTERNAL_ID object EXTERNAL_ID An optional string ID generated by the posting application. ID object ID A string ID that is permanently associated with this activity. This value can not be set. MEDIA_ITEMS object MEDIA_ITEMS Any photos, videos, or images that should be associated with the activity. Higher priority ones are higher in the list. The data has type Array< MediaItem>. POSTED_TIME object POSTED_TIME A string specifying the time at which this activity took place in milliseconds since the epoch. This value can not be set. PRIORITY object PRIORITY A number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source STREAM_FAVICON_URL object STREAM_FAVICON_URL A string specifying the URL for the stream's favicon. STREAM_SOURCE_URL object STREAM_SOURCE_URL A string specifying the stream's source URL. STREAM_TITLE object STREAM_TITLE A string specifing the title of the stream. STREAM_URL object STREAM_URL A string specifying the stream's URL. TEMPLATE_PARAMS 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. 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: o o o o PersonKey.DisplayName - Display name for the person PersonKey.ProfileUrl. URL of the person's profile PersonKey.Id - The ID of the person PersonKey - Container may replace with DisplayName, but may also optionally link to the user. TITLE object TITLE A string specifying the primary text of an activity. Titles may only have the following HTML tags: , , . The container may ignore this formatting when rendering the activity. TITLE_ID 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: , , . The container may ignore this formatting when rendering the activity. URL object URL A string specifying the URL that represents this activity. USER_ID object USER_ID The string ID of the user who this activity is for. This value can not be set. Back to top Class opensocial.Address SUMMARY DETAIL Base interface for all address objects. Method Summary String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Address.Field Map. opt_params - Additional params to pass to the request Returns: String The data Back to top Static Class opensocial.Address.Field SUMMARY DETAIL All of the fields that an address has. These are the supported keys for the Address.getField() method. Field Summary object COUNTRY The country, specified as a string. object EXTENDED_ADDRESS The extended street address, specified as a string. object LATITUDE The latitude, specified as a number. object LOCALITY The locality, specified as a string. object LONGITUDE The longitude, specified as a number. object PO_BOX The P.O. object POSTAL_CODE The postal code, specified as a string. object REGION The region, specified as a string. object STREET_ADDRESS The street address, specified as a string. object TYPE The address type or label, specified as a string. object UNSTRUCTURED_ADDRESS If the container does not have structured addresses in its data store, this field contains the unstructured address that the user entered, specified as a string. Field Detail COUNTRY object COUNTRY The country, specified as a string. EXTENDED_ADDRESS object EXTENDED_ADDRESS The extended street address, specified as a string. LATITUDE object LATITUDE The latitude, specified as a number. LOCALITY object LOCALITY The locality, specified as a string. LONGITUDE object LONGITUDE The longitude, specified as a number. PO_BOX object PO_BOX The P.O. box of the address, if there is one; specified as a string. POSTAL_CODE object POSTAL_CODE The postal code, specified as a string. REGION object REGION The region, specified as a string. STREET_ADDRESS object STREET_ADDRESS The street address, specified as a string. TYPE object TYPE The address type or label, specified as a string. Examples: work, my favorite store, my house, etc. UNSTRUCTURED_ADDRESS object UNSTRUCTURED_ADDRESS If the container does not have structured addresses in its data store, this field contains the unstructured address that the user entered, specified as a string. Use opensocial.getEnvironment().supportsField to see which fields are supported. Back to top Class opensocial.BodyType SUMMARY DETAIL Base interface for all body type objects. Method Summary String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in BodyType.Field Map. opt_params - Additional params to pass to the request. Returns: String The data Back to top Static Class opensocial.BodyType.Field SUMMARY DETAIL All of the fields that a body type has. These are the supported keys for the BodyType.getField() method. Field Summary object BUILD The build of the person's body, specified as a string. object EYE_COLOR The eye color of the person, specified as a string. object HAIR_COLOR The hair color of the person, specified as a string. object HEIGHT The height of the person in meters, specified as a number. object WEIGHT The weight of the person in kilograms, specified as a number. Field Detail BUILD object BUILD The build of the person's body, specified as a string. Container support for this field is OPTIONAL. EYE_COLOR object EYE_COLOR The eye color of the person, specified as a string. Container support for this field is OPTIONAL. HAIR_COLOR object HAIR_COLOR The hair color of the person, specified as a string. Container support for this field is OPTIONAL. HEIGHT object HEIGHT The height of the person in meters, specified as a number. Container support for this field is OPTIONAL. WEIGHT object WEIGHT The weight of the person in kilograms, specified as a number. Container support for this field is OPTIONAL. Back to top Class opensocial.Collection SUMMARY DETAIL 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. Method Summary Array. asArray() Returns an array of all the objects in this collection. each(fn) Executes the provided function once per member of the collection, with each member in turn as the parameter to the function. Object? getById(id) Finds the entry with the given ID value, or returns null if none is found. Number getOffset() Gets the offset of this collection within a larger result set. Number getTotalSize() Gets the total size of the larger result set that this collection belongs to. Number size() Gets the size of this collection, which is equal to or less than the total size of the result. Method Detail asArray Array. asArray() Returns an array of all the objects in this collection. Returns: Array. The values in this collection each each(fn) Executes the provided function once per member of the collection, with each member in turn as the parameter to the function. Parameters: Function fn - The function to call with each collection entry getById Object? getById(id) Finds the entry with the given ID value, or returns null if none is found. Parameters: String id - The ID to look for Returns: Object? The data getOffset Number getOffset() Gets the offset of this collection within a larger result set. Returns: Number The offset into the total collection getTotalSize Number getTotalSize() Gets the total size of the larger result set that this collection belongs to. Returns: Number The total size of the result size Number size() Gets the size of this collection, which is equal to or less than the total size of the result. Returns: Number The size of this collection Back to top Static Class opensocial.CreateActivityPriority SUMMARY DETAIL The priorities a create activity request can have. See also: opensocial.requestCreateActivity() Field Summary object HIGH If the activity is of high importance, it will be created even if this requires asking the user for permission. object LOW If the activity is of low importance, it will not be created if the user has not given permission for the current app to create activities. Field Detail HIGH object HIGH If the activity is of high importance, it will be created even if this requires asking the user for permission. This may cause the container to open a user flow which may navigate away from your gagdet. LOW object LOW If the activity is of low importance, it will not be created if the user has not given permission for the current app to create activities. With this priority, the requestCreateActivity call will never open a user flow. Back to top Class opensocial.DataRequest SUMMARY DETAIL 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() Method Summary add(request, opt_key) Adds an item to fetch (get) or update (set) data from the server. Object newFetchActivitiesRequest(idSpec, opt_params) Creates an item to request an activity stream from the server. Object newFetchPeopleRequest(idSpec, opt_params) Creates an item to request friends from the server. Object newFetchPersonAppDataRequest(idSpec, keys, opt_params) Creates an item to request app data for the given people. Object newFetchPersonRequest(id, opt_params) Creates an item to request a profile for the specified person ID. Object newRemovePersonAppDataRequest(id, keys) Deletes the given keys from the datastore for the given person. Object newUpdatePersonAppDataRequest(id, key, value) Creates an item to request an update of an app field for the given person. send(opt_callback) Sends a data request to the server in order to get a data response. Method Detail add add(request, opt_key) Adds an item to fetch (get) or update (set) data from the server. A single DataRequest object can have multiple items. As a rule, each item is executed in the order it was added, starting with the item that was added first. However, items that can't collide might be executed in parallel. Parameters: Object request - Specifies which data to fetch or update String opt_key - A key to map the generated response data to newFetchActivitiesRequest Object newFetchActivitiesRequest(idSpec, opt_params) Creates an item to request an activity stream from the server. When processed, returns a Collection. Parameters: opensocial.IdSpec idSpec - An IdSpec used to specify which people to fetch. See also IdSpec. Map. opt_params - Additional parameters to pass to the request; not currently used Returns: Object A request object newFetchPeopleRequest Object newFetchPeopleRequest(idSpec, opt_params) Creates an item to request friends from the server. When processed, returns a Collection object. Parameters: opensocial.IdSpec idSpec - An IdSpec used to specify which people to fetch. See also IdSpec. Map. opt_params - Additional params to pass to the request Returns: Object A request object newFetchPersonAppDataRequest Object newFetchPersonAppDataRequest(idSpec, keys, opt_params) Creates an item to request app data for the given people. When processed, returns a Map< PersonId, Map> object. All of the data values returned will be valid json. Parameters: opensocial.IdSpec idSpec - An IdSpec used to specify which people to fetch. See also IdSpec. Array., 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. opt_params - Additional params to pass to the request Returns: Object A request object newFetchPersonRequest Object newFetchPersonRequest(id, opt_params) Creates an item to request a profile for the specified person ID. When processed, returns a Person object. Parameters: String id - The ID of the person to fetch; can be the standard person ID of VIEWER or OWNER Map. opt_params - Additional parameters to pass to the request; this request supports PROFILE_DETAILS Returns: Object A request object newRemovePersonAppDataRequest Object newRemovePersonAppDataRequest(id, keys) Deletes the given keys from the datastore for the given person. When processed, does not return any data. Parameters: String id - The ID of the person to update; only the special VIEWER ID is currently allowed. Array., 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" Returns: Object A request object newUpdatePersonAppDataRequest Object newUpdatePersonAppDataRequest(id, key, value) Creates an item to request an update of an app field for the given person. When processed, does not return any data. Parameters: 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 Returns: Object A request object send send(opt_callback) Sends a data request to the server in order to get a data response. Although the server may optimize these requests, they will always be executed as though they were serial. Parameters: Function opt_callback - The function to call with the data response generated by the server Back to top Static Class opensocial.DataRequest.DataRequestFields SUMMARY DETAIL Field Summary object ESCAPE_TYPE How to escape person data returned from the server; defaults to HTML_ESCAPE. Field Detail ESCAPE_TYPE object ESCAPE_TYPE How to escape person data returned from the server; defaults to HTML_ESCAPE. Possible values are defined by EscapeType. Back to top Static Class opensocial.DataRequest.FilterType SUMMARY DETAIL The filters available for limiting person requests. Field Summary object ALL Retrieves all friends. object HAS_APP Retrieves all friends that use this application. object TOP_FRIENDS Retrieves only the user's top friends as defined by the container. Field Detail ALL object ALL Retrieves all friends. HAS_APP object HAS_APP Retrieves all friends that use this application. Note: Containers may define "use" in any manner they deem appropriate for their functionality, and it is not expected that this field will have the exact same semantics across containers. TOP_FRIENDS object TOP_FRIENDS Retrieves only the user's top friends as defined by the container. Container support for this filter type is OPTIONAL. Back to top Static Class opensocial.DataRequest.PeopleRequestFields SUMMARY DETAIL Field Summary object FILTER How to filter the people objects; defaults to ALL. object FILTER_OPTIONS Additional options to be passed into the filter, specified as a Map. object FIRST When paginating, the index of the first item to fetch; specified as a number. object MAX The maximum number of items to fetch, specified as a number; defaults to 20. object PROFILE_DETAILS An array of opensocial.Person.Field specifying what profile data to fetch for each of the person objects. object SORT_ORDER A sort order for the people objects; defaults to TOP_FRIENDS. Field Detail FILTER object FILTER How to filter the people objects; defaults to ALL. Possible values are defined by FilterType. FILTER_OPTIONS object FILTER_OPTIONS Additional options to be passed into the filter, specified as a Map. FIRST object FIRST When paginating, the index of the first item to fetch; specified as a number. MAX object MAX The maximum number of items to fetch, specified as a number; defaults to 20. If set to a larger number, a container may honor the request, or may limit the number to a container-specified limit of at least 20. PROFILE_DETAILS object PROFILE_DETAILS An array of 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. SORT_ORDER object SORT_ORDER A sort order for the people objects; defaults to TOP_FRIENDS. Possible values are defined by SortOrder. Back to top Static Class opensocial.DataRequest.SortOrder SUMMARY DETAIL The sort orders available for ordering person objects. Field Summary object NAME When used will sort people alphabetically by the name field. object TOP_FRIENDS When used will sort people by the container's definition of top friends. Field Detail NAME object NAME When used will sort people alphabetically by the name field. TOP_FRIENDS object TOP_FRIENDS When used will sort people by the container's definition of top friends. Back to top Class opensocial.DataResponse SUMMARY DETAIL This object contains the requested server data mapped to the requested keys. See also: DataRequest Method Summary opensocial.ResponseItem get(key) Gets the ResponseItem for the requested field. String getErrorMessage() If the entire request had a batch level error, returns the error message. Boolean hadError() Returns true if there was an error in fetching this data from the server. Method Detail get opensocial.ResponseItem get(key) Gets the ResponseItem for the requested field. Parameters: key Returns: opensocial.ResponseItem The requested response calculated by the server getErrorMessage String getErrorMessage() If the entire request had a batch level error, returns the error message. Returns: String A human-readable description of the error that occurred. hadError Boolean hadError() Returns true if there was an error in fetching this data from the server. Returns: Boolean True if there was an error; otherwise, false Back to top Class opensocial.Email SUMMARY DETAIL Base interface for all email objects. Method Summary String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Email.Field Map. opt_params - Additional params to pass to the request. Returns: String The data Back to top Static Class opensocial.Email.Field SUMMARY DETAIL All of the fields that an email has. These are the supported keys for the Email.getField() method. Field Summary object ADDRESS The email address, specified as a string. object TYPE The email type or label, specified as a string. Field Detail ADDRESS object ADDRESS The email address, specified as a string. TYPE object TYPE The email type or label, specified as a string. Examples: work, my favorite store, my house, etc. Back to top Class opensocial.Enum SUMMARY DETAIL 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. Method Summary String getDisplayValue() The value of this enum. String getKey() Use this for logic within your gadget. Method Detail getDisplayValue String getDisplayValue() The value of this enum. This will be a user displayable string. If the container supports localization, the string will be localized. Returns: String The enum's value. getKey String getKey() Use this for logic within your gadget. If they key is null then the value does not fit in the defined enums. Returns: String The enum's key. This should be one of the defined enums below. Back to top Static Class opensocial.Enum.Drinker SUMMARY DETAIL The enum keys used by the drinker field. See also: opensocial.Person.Field.Drinker Field Summary object object object object object object object object HEAVILY NO OCCASIONALLY QUIT QUITTING REGULARLY SOCIALLY YES Field Detail HEAVILY object HEAVILY NO object NO OCCASIONALLY object OCCASIONALLY QUIT object QUIT QUITTING object QUITTING REGULARLY object REGULARLY SOCIALLY object SOCIALLY YES object YES Back to top Static Class opensocial.Enum.Gender SUMMARY DETAIL The enum keys used by the gender field. See also: opensocial.Person.Field.Gender Field Summary object FEMALE object MALE Field Detail FEMALE object FEMALE MALE object MALE Back to top Static Class opensocial.Enum.LookingFor SUMMARY DETAIL The enum keys used by the lookingFor field. See also: opensocial.Person.Field.LookingFor Field Summary object object object object object object ACTIVITY_PARTNERS DATING FRIENDS NETWORKING RANDOM RELATIONSHIP Field Detail ACTIVITY_PARTNERS object ACTIVITY_PARTNERS DATING object DATING FRIENDS object FRIENDS NETWORKING object NETWORKING RANDOM object RANDOM RELATIONSHIP object RELATIONSHIP Back to top Static Class opensocial.Enum.Presence SUMMARY DETAIL The enum keys used by the networkPresence field. See also: opensocial.Person.Field.NetworkPresence Field Summary object AWAY The entity or resource is temporarily away. object CHAT The entity or resource is actively interested in chatting. object DND The entity or resource is busy (dnd = "Do Not Disturb"). object OFFLINE The entity or resource is off line. object ONLINE The entity or resource is on line. object XA The entity or resource is away for an extended period (xa = "eXtended Away"). Field Detail AWAY object AWAY The entity or resource is temporarily away. CHAT object CHAT The entity or resource is actively interested in chatting. DND object DND The entity or resource is busy (dnd = "Do Not Disturb"). OFFLINE object OFFLINE The entity or resource is off line. ONLINE object ONLINE The entity or resource is on line. XA object XA The entity or resource is away for an extended period (xa = "eXtended Away"). Back to top Static Class opensocial.Enum.Smoker SUMMARY DETAIL The enum keys used by the smoker field. See also: opensocial.Person.Field.Smoker Field Summary object object object object object object object object HEAVILY NO OCCASIONALLY QUIT QUITTING REGULARLY SOCIALLY YES Field Detail HEAVILY object HEAVILY NO object NO OCCASIONALLY object OCCASIONALLY QUIT object QUIT QUITTING object QUITTING REGULARLY object REGULARLY SOCIALLY object SOCIALLY YES object YES Back to top Class opensocial.Environment SUMMARY DETAIL Represents the current environment for a gadget. See also: opensocial.getEnvironment(), Method Summary String getDomain() Returns the current domain — for example, "orkut.com" or "myspace.com". Boolean supportsField(objectType, fieldName) Returns true if the specified field is supported in this container on the given object type. Method Detail getDomain String getDomain() Returns the current domain — for example, "orkut.com" or "myspace.com". Returns: String The domain supportsField Boolean supportsField(objectType, fieldName) Returns true if the specified field is supported in this container on the given object type. Parameters: opensocial.Environment.ObjectType objectType - The object type to check for the field String fieldName - The name of the field to check for Returns: Boolean True if the field is supported on the specified object type Back to top Static Class opensocial.Environment.ObjectType SUMMARY DETAIL The types of objects in this container. See also: Environment.supportsField() Field Summary object object object object object ACTIVITY ADDRESS BODY_TYPE EMAIL FILTER_TYPE object object object object object object object object object MEDIA_ITEM MESSAGE MESSAGE_TYPE NAME ORGANIZATION PERSON PHONE SORT_ORDER URL Field Detail ACTIVITY object ACTIVITY ADDRESS object ADDRESS BODY_TYPE object BODY_TYPE EMAIL object EMAIL FILTER_TYPE object FILTER_TYPE MEDIA_ITEM object MEDIA_ITEM MESSAGE object MESSAGE MESSAGE_TYPE object MESSAGE_TYPE NAME object NAME ORGANIZATION object ORGANIZATION PERSON object PERSON PHONE object PHONE SORT_ORDER object SORT_ORDER URL object URL Back to top Static Class opensocial.EscapeType SUMMARY DETAIL The types of escaping that can be applied to person data or fields. Field Summary object HTML_ESCAPE When used will HTML-escape the data. object NONE When used will not escape the data. Field Detail HTML_ESCAPE object HTML_ESCAPE When used will HTML-escape the data. NONE object NONE When used will not escape the data. Back to top Class opensocial.IdSpec SUMMARY DETAIL Base interface for all id spec objects. Method Summary String getField(key, opt_params) Gets the id spec's data that's associated with the specified key. setField(key, data) Sets data for this id spec associated with the given key. Method Detail getField String getField(key, opt_params) Gets the id spec's data that's associated with the specified key. Parameters: String key - The key to get data for; see the Field class for possible values Map. opt_params - Additional params to pass to the request. Returns: String The data setField setField(key, data) Sets data for this id spec associated with the given key. Parameters: String key - The key to set data for String data - The data to set Back to top Static Class opensocial.IdSpec.Field SUMMARY DETAIL All of the fields that id specs can have. See also: opensocial.IdSpec.getField() Field Summary object GROUP_ID A string representing the group id. object NETWORK_DISTANCE An optional numeric parameter, used to specify how many "hops" are allowed between two people still considered part of the same group. object USER_ID A string or an array of strings representing the user id. Field Detail GROUP_ID object GROUP_ID A string representing the group id. NETWORK_DISTANCE object NETWORK_DISTANCE An optional numeric parameter, used to specify how many "hops" are allowed between two people still considered part of the same group. This is 0 based, for example: A value of 0 means that the people are the same person. 1 would mean that the people were friends. And 2 would mean that there was a friend of a friend relationship. Defaults to 1 (they are both friends or directly in the same group). Not all containers will support networkDistances greater than 1. USER_ID object USER_ID A string or an array of strings representing the user id. Back to top Static Class opensocial.IdSpec.PersonId SUMMARY DETAIL Constant person IDs available when fetching person information. Field Summary object OWNER object VIEWER Field Detail OWNER object OWNER VIEWER object VIEWER Back to top Class opensocial.MediaItem SUMMARY DETAIL Represents images, movies, and audio. Create a MediaItem object using the opensocial.newMediaItem() method. Method Summary String getField(key, opt_params) Gets the media item data that's associated with the specified key. setField(key, data) Sets data for this media item associated with the given key. Method Detail getField String getField(key, opt_params) Gets the media item data that's associated with the specified key. Parameters: String key - The key to get data for; see the Field class for possible values Map. opt_params - Additional params to pass to the request. Returns: String The data setField setField(key, data) Sets data for this media item associated with the given key. Parameters: String key - The key to set data for String data - The data to set Back to top Static Class opensocial.MediaItem.Field SUMMARY DETAIL All of the fields that media items have. See also: opensocial.MediaItem.getField() Field Summary object MIME_TYPE The MIME type of media, specified as a string. object TYPE The type of media, specified as a MediaItem.Type object. object URL A string specifying the URL where the media can be found. Field Detail MIME_TYPE object MIME_TYPE The MIME type of media, specified as a string. TYPE object TYPE The type of media, specified as a MediaItem.Type object. URL object URL A string specifying the URL where the media can be found. Back to top Static Class opensocial.MediaItem.Type SUMMARY DETAIL The possible types of media items. See also: opensocial.MediaItem.Field Field Summary object AUDIO object IMAGE object VIDEO Field Detail AUDIO object AUDIO IMAGE object IMAGE VIDEO object VIDEO Back to top Class opensocial.Message SUMMARY DETAIL Base interface for all message objects. * See also: opensocial.newMessage(), opensocial.requestSendMessage() Method Summary String getField(key, opt_params) Gets the message data that's associated with the specified key. setField(key, data) Sets data for this message associated with the given key. Method Detail getField String getField(key, opt_params) Gets the message data that's associated with the specified key. Parameters: String key - The key to get data for; see the Field class for possible values Map. opt_params - Additional params to pass to the request. Returns: String The data setField setField(key, data) Sets data for this message associated with the given key. Parameters: String key - The key to set data for String data - The data to set Back to top Static Class opensocial.Message.Field SUMMARY DETAIL All of the fields that messages can have. See also: opensocial.Message.getField() Field Summary object BODY The main text of the message. object BODY_ID The main text of the message as a message template. object TITLE The title of the message. object TITLE_ID The title of the message as a message template. object TYPE The title of the message, specified as an opensocial.Message.Type. Field Detail BODY object BODY The main text of the message. HTML attributes are allowed and are sanitized by the container. BODY_ID object BODY_ID The main text of the message as a message template. Specifies the message ID to use in the gadget xml. TITLE object TITLE The title of the message. HTML attributes are allowed and are sanitized by the container. TITLE_ID object TITLE_ID The title of the message as a message template. Specifies the message ID to use in the gadget xml. TYPE object TYPE The title of the message, specified as an opensocial.Message.Type. Back to top Static Class opensocial.Message.Type SUMMARY DETAIL The types of messages that can be sent. Field Summary object EMAIL An email. object NOTIFICATION A short private message. object PRIVATE_MESSAGE A message to a specific user that can be seen only by that user. object PUBLIC_MESSAGE A message to a specific user that can be seen by more than that user. Field Detail EMAIL object EMAIL An email. NOTIFICATION object NOTIFICATION A short private message. PRIVATE_MESSAGE object PRIVATE_MESSAGE A message to a specific user that can be seen only by that user. PUBLIC_MESSAGE object PUBLIC_MESSAGE A message to a specific user that can be seen by more than that user. Back to top Class opensocial.Name SUMMARY DETAIL Base interface for all name objects. Method Summary String getField(key, opt_params) Gets data for this name that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this name that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Name.Field Map. opt_params - Additional params to pass to the request. Returns: String The data Back to top Static Class opensocial.Name.Field SUMMARY DETAIL All of the fields that a name has. These are the supported keys for the Name.getField() method. Field Summary object ADDITIONAL_NAME The additional name, specified as a string. object FAMILY_NAME The family name, specified as a string. object GIVEN_NAME The given name, specified as a string. object HONORIFIC_PREFIX The honorific prefix, specified as a string. object HONORIFIC_SUFFIX The honorific suffix, specified as a string. object UNSTRUCTURED The unstructured name, specified as a string. Field Detail ADDITIONAL_NAME object ADDITIONAL_NAME The additional name, specified as a string. FAMILY_NAME object FAMILY_NAME The family name, specified as a string. GIVEN_NAME object GIVEN_NAME The given name, specified as a string. HONORIFIC_PREFIX object HONORIFIC_PREFIX The honorific prefix, specified as a string. HONORIFIC_SUFFIX object HONORIFIC_SUFFIX The honorific suffix, specified as a string. UNSTRUCTURED object UNSTRUCTURED The unstructured name, specified as a string. Back to top Class opensocial.NavigationParameters SUMMARY DETAIL 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. Method Summary String getField(key, opt_params) Gets the NavigationParameters' data that's associated with the specified key. setField(key, data) Sets data for this NavigationParameters associated with the given key. Method Detail getField String getField(key, opt_params) Gets the NavigationParameters' data that's associated with the specified key. Parameters: String key - The key to get data for; see the Field class for possible values Map. opt_params - Additional params to pass to the request. Returns: String The data setField setField(key, data) Sets data for this NavigationParameters associated with the given key. Parameters: String key - The key to set data for Object data - The data to set Back to top Static Class opensocial.NavigationParameters.DestinationType SUMMARY DETAIL The destinations available for navigation in requestShareApp and requestSendMessage. Field Summary object RECIPIENT_DESTINATION object VIEWER_DESTINATION Field Detail RECIPIENT_DESTINATION object RECIPIENT_DESTINATION VIEWER_DESTINATION object VIEWER_DESTINATION Back to top Static Class opensocial.NavigationParameters.Field SUMMARY DETAIL All of the fields that NavigationParameters can have. See also: opensocial.NavigationParameters.getField() Field Summary object OWNER A string representing the owner id. object PARAMETERS An optional list of parameters passed to the gadget once the new view, with the new owner, has been loaded. object VIEW The View to navigate to. Field Detail OWNER object OWNER A string representing the owner id. PARAMETERS object PARAMETERS An optional list of parameters passed to the gadget once the new view, with the new owner, has been loaded. VIEW object VIEW The View to navigate to. Back to top Class opensocial.Organization SUMMARY DETAIL Base interface for all organization objects. Method Summary String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this body type that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Organization.Field Map. opt_params - Additional params to pass to the request Returns: String The data Back to top Static Class opensocial.Organization.Field SUMMARY DETAIL All of the fields that a organization has. These are the supported keys for the Organization.getField() method. Field Summary object ADDRESS The address of the organization, specified as an opensocial.Address. object DESCRIPTION A description or notes about the person's work in the organization, specified as a string. object END_DATE The date the person stopped at the organization, specified as a Date. object FIELD The field the organization is in, specified as a string. object NAME The name of the organization, specified as a string. object SALARY The salary the person receieves from the organization, specified as a string. object START_DATE The date the person started at the organization, specified as a Date. object SUB_FIELD The subfield the Organization is in, specified as a string. object TITLE The title or role the person has in the organization, specified as a string. object WEBPAGE A webpage related to the organization, specified as a string. Field Detail ADDRESS object ADDRESS The address of the organization, specified as an opensocial.Address. Container support for this field is OPTIONAL. DESCRIPTION object DESCRIPTION A description or notes about the person's work in the organization, specified as a string. This could be the courses taken by a student, or a more detailed description about a Organization role. Container support for this field is OPTIONAL. END_DATE object END_DATE The date the person stopped at the organization, specified as a Date. A null date indicates that the person is still involved with the organization. Container support for this field is OPTIONAL. FIELD object FIELD The field the organization is in, specified as a string. This could be the degree pursued if the organization is a school. Container support for this field is OPTIONAL. NAME object NAME The name of the organization, specified as a string. For example, could be a school name or a job company. Container support for this field is OPTIONAL. SALARY object SALARY The salary the person receieves from the organization, specified as a string. Container support for this field is OPTIONAL. START_DATE object START_DATE The date the person started at the organization, specified as a Date. Container support for this field is OPTIONAL. SUB_FIELD object SUB_FIELD The subfield the Organization is in, specified as a string. Container support for this field is OPTIONAL. TITLE object TITLE The title or role the person has in the organization, specified as a string. This could be graduate student, or software engineer. Container support for this field is OPTIONAL. WEBPAGE object WEBPAGE A webpage related to the organization, specified as a string. Container support for this field is OPTIONAL. Back to top Static Class opensocial.Permission SUMMARY DETAIL The permissions an app can ask for. See also: opensocial.hasPermission(), opensocial.requestPermission() Field Summary object VIEWER Access to the viewer person object Field Detail VIEWER object VIEWER Access to the viewer person object Back to top Class opensocial.Person SUMMARY DETAIL Base interface for all person objects. Method Summary String getDisplayName() Gets a text display name for this person; guaranteed to return a useful string. String getField(key, opt_params) Gets data for this person that is associated with the specified key. String getId() Gets an ID that can be permanently associated with this person. Boolean isOwner() Returns true if this person object represents the owner of the current page. Boolean isViewer() Returns true if this person object represents the currently logged in user. Method Detail getDisplayName String getDisplayName() Gets a text display name for this person; guaranteed to return a useful string. Returns: String The display name getField String getField(key, opt_params) Gets data for this person that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Person.Field Map. opt_params - Additional params to pass to the request. Returns: String The data getId String getId() Gets an ID that can be permanently associated with this person. Returns: String The ID isOwner Boolean isOwner() Returns true if this person object represents the owner of the current page. Returns: Boolean True if this is the owner of the page; otherwise, false isViewer Boolean isViewer() Returns true if this person object represents the currently logged in user. Returns: Boolean True if this is the currently logged in user; otherwise, false Back to top Static Class opensocial.Person.Field SUMMARY DETAIL All of the fields that a person has. These are the supported keys for the Person.getField() method. Field Summary object ABOUT_ME A general statement about the person, specified as a string. object ACTIVITIES Person's favorite activities, specified as an Array of strings. object ADDRESSES Addresses associated with the person, specified as an Array of Addresses. object AGE Person's age, specified as a number. object BODY_TYPE Person's body characteristics, specified as an opensocial.BodyType. object BOOKS Person's favorite books, specified as an Array of strings. object CARS Person's favorite cars, specified as an Array of strings. object CHILDREN Description of the person's children, specified as a string. object CURRENT_LOCATION Person's current location, specified as an Address. object DATE_OF_BIRTH Person's date of birth, specified as a Date object. object DRINKER Person's drinking status, specified as an opensocial.Enum with the enum's key referencing opensocial.Enum.Drinker. object EMAILS Emails associated with the person, specified as an Array of Emails. object ETHNICITY Person's ethnicity, specified as a string. object FASHION Person's thoughts on fashion, specified as a string. object FOOD Person's favorite food, specified as an Array of strings. object GENDER Person's gender, specified as an opensocial.Enum with the enum's key referencing opensocial.Enum.Gender. object HAPPIEST_WHEN Describes when the person is happiest, specified as a string. object HAS_APP A boolean indicating whether the person has used the current app. object HEROES Person's favorite heroes, specified as an Array of strings. object HUMOR Person's thoughts on humor, specified as a string. object ID A string ID that can be permanently associated with this person. object INTERESTS Person's interests, hobbies or passions, specified as an Array of strings. object JOB_INTERESTS Person's favorite jobs, or job interests and skills, specified as a string. object JOBS Jobs the person has held, specified as an Array of Organizations. object LANGUAGES_SPOKEN List of the languages that the person speaks as ISO 639-1 codes, specified as an Array of strings. object LIVING_ARRANGEMENT Description of the person's living arrangement, specified as a string. object LOOKING_FOR Person's statement about who or what they are looking for, or what they are interested in meeting people for. object MOVIES Person's favorite movies, specified as an Array of strings. object MUSIC Person's favorite music, specified as an Array of strings. object NAME A opensocial.Name object containing the person's name. object NETWORK_PRESENCE Person's current network status. object NICKNAME A String representing the person's nickname. object PETS Description of the person's pets, specified as a string. object PHONE_NUMBERS Phone numbers associated with the person, specified as an Array of Phones. object POLITICAL_VIEWS Person's political views, specified as a string. object PROFILE_SONG Person's profile song, specified as an opensocial.Url. object PROFILE_URL Person's profile URL, specified as a string. object PROFILE_VIDEO Person's profile video, specified as an opensocial.Url. object QUOTES Person's favorite quotes, specified as an Array of strings. object RELATIONSHIP_STATUS Person's relationship status, specified as a string. object RELIGION Person's relgion or religious views, specified as a string. object ROMANCE Person's comments about romance, specified as a string. object SCARED_OF What the person is scared of, specified as a string. object SCHOOLS Schools the person has attended, specified as an Array of Organizations. object SEXUAL_ORIENTATION Person's sexual orientation, specified as a string. object SMOKER Person's smoking status, specified as an opensocial.Enum with the enum's key referencing opensocial.Enum.Smoker. object SPORTS Person's favorite sports, specified as an Array of strings. object STATUS Person's status, headline or shoutout, specified as a string. object TAGS Arbitrary tags about the person, specified as an Array of strings. object THUMBNAIL_URL Person's photo thumbnail URL, specified as a string. object TIME_ZONE Person's time zone, specified as the difference in minutes between Greenwich Mean Time (GMT) and the user's local time. object TURN_OFFS Person's turn offs, specified as an Array of strings. object TURN_ONS Person's turn ons, specified as an Array of strings. object TV_SHOWS Person's favorite TV shows, specified as an Array of strings. object URLS URLs related to the person, their webpages, or feeds. Field Detail ABOUT_ME object ABOUT_ME A general statement about the person, specified as a string. Container support for this field is OPTIONAL. ACTIVITIES object ACTIVITIES Person's favorite activities, specified as an Array of strings. Container support for this field is OPTIONAL. ADDRESSES object ADDRESSES Addresses associated with the person, specified as an Array of Addresses. Container support for this field is OPTIONAL. AGE object AGE Person's age, specified as a number. Container support for this field is OPTIONAL. BODY_TYPE object BODY_TYPE Person's body characteristics, specified as an opensocial.BodyType. Container support for this field is OPTIONAL. BOOKS object BOOKS Person's favorite books, specified as an Array of strings. Container support for this field is OPTIONAL. CARS object CARS Person's favorite cars, specified as an Array of strings. Container support for this field is OPTIONAL. CHILDREN object CHILDREN Description of the person's children, specified as a string. Container support for this field is OPTIONAL. CURRENT_LOCATION object CURRENT_LOCATION Person's current location, specified as an Address. Container support for this field is OPTIONAL. DATE_OF_BIRTH object DATE_OF_BIRTH Person's date of birth, specified as a Date object. Container support for this field is OPTIONAL. DRINKER object DRINKER Person's drinking status, specified as an opensocial.Enum with the enum's key referencing opensocial.Enum.Drinker. Container support for this field is OPTIONAL. EMAILS object EMAILS Emails associated with the person, specified as an Array of Emails. Container support for this field is OPTIONAL. ETHNICITY object ETHNICITY Person's ethnicity, specified as a string. Container support for this field is OPTIONAL. FASHION object FASHION Person's thoughts on fashion, specified as a string. Container support for this field is OPTIONAL. FOOD object FOOD Person's favorite food, specified as an Array of strings. Container support for this field is OPTIONAL. GENDER object GENDER Person's gender, specified as an opensocial.Enum with the enum's key referencing opensocial.Enum.Gender. Container support for this field is OPTIONAL. HAPPIEST_WHEN object HAPPIEST_WHEN Describes when the person is happiest, specified as a string. Container support for this field is OPTIONAL. HAS_APP object HAS_APP A boolean indicating whether the person has used the current app. Container support for this field is OPTIONAL. HEROES object HEROES Person's favorite heroes, specified as an Array of strings. Container support for this field is OPTIONAL. HUMOR object HUMOR Person's thoughts on humor, specified as a string. Container support for this field is OPTIONAL. ID object ID A string ID that can be permanently associated with this person. INTERESTS object INTERESTS Person's interests, hobbies or passions, specified as an Array of strings. Container support for this field is OPTIONAL. JOB_INTERESTS object JOB_INTERESTS Person's favorite jobs, or job interests and skills, specified as a string. Container support for this field is OPTIONAL. JOBS object JOBS Jobs the person has held, specified as an Array of Organizations. Container support for this field is OPTIONAL. LANGUAGES_SPOKEN object LANGUAGES_SPOKEN List of the languages that the person speaks as ISO 639-1 codes, specified as an Array of strings. Container support for this field is OPTIONAL. LIVING_ARRANGEMENT object LIVING_ARRANGEMENT Description of the person's living arrangement, specified as a string. Container support for this field is OPTIONAL. LOOKING_FOR object LOOKING_FOR Person's statement about who or what they are looking for, or what they are interested in meeting people for. Specified as an Array of opensocial.Enum with the enum's key referencing opensocial.Enum.LookingFor. Container support for this field is OPTIONAL. MOVIES object MOVIES Person's favorite movies, specified as an Array of strings. Container support for this field is OPTIONAL. MUSIC object MUSIC Person's favorite music, specified as an Array of strings. Container support for this field is OPTIONAL. NAME object NAME A opensocial.Name object containing the person's name. NETWORK_PRESENCE object NETWORK_PRESENCE Person's current network status. Specified as an Enum with the enum's key referencing opensocial.Enum.Presence. Container support for this field is OPTIONAL. NICKNAME object NICKNAME A String representing the person's nickname. PETS object PETS Description of the person's pets, specified as a string. Container support for this field is OPTIONAL. PHONE_NUMBERS object PHONE_NUMBERS Phone numbers associated with the person, specified as an Array of Phones. Container support for this field is OPTIONAL. POLITICAL_VIEWS object POLITICAL_VIEWS Person's political views, specified as a string. Container support for this field is OPTIONAL. PROFILE_SONG object PROFILE_SONG Person's profile song, specified as an opensocial.Url. Container support for this field is OPTIONAL. PROFILE_URL object PROFILE_URL Person's profile URL, specified as a string. This URL must be fully qualified. Relative URLs will not work in gadgets. Container support for this field is OPTIONAL. PROFILE_VIDEO object PROFILE_VIDEO Person's profile video, specified as an opensocial.Url. Container support for this field is OPTIONAL. QUOTES object QUOTES Person's favorite quotes, specified as an Array of strings. Container support for this field is OPTIONAL. RELATIONSHIP_STATUS object RELATIONSHIP_STATUS Person's relationship status, specified as a string. Container support for this field is OPTIONAL. RELIGION object RELIGION Person's relgion or religious views, specified as a string. Container support for this field is OPTIONAL. ROMANCE object ROMANCE Person's comments about romance, specified as a string. Container support for this field is OPTIONAL. SCARED_OF object SCARED_OF What the person is scared of, specified as a string. Container support for this field is OPTIONAL. SCHOOLS object SCHOOLS Schools the person has attended, specified as an Array of Organizations. Container support for this field is OPTIONAL. SEXUAL_ORIENTATION object SEXUAL_ORIENTATION Person's sexual orientation, specified as a string. Container support for this field is OPTIONAL. SMOKER object SMOKER Person's smoking status, specified as an opensocial.Enum with the enum's key referencing opensocial.Enum.Smoker. Container support for this field is OPTIONAL. SPORTS object SPORTS Person's favorite sports, specified as an Array of strings. Container support for this field is OPTIONAL. STATUS object STATUS Person's status, headline or shoutout, specified as a string. Container support for this field is OPTIONAL. TAGS object TAGS Arbitrary tags about the person, specified as an Array of strings. Container support for this field is OPTIONAL. THUMBNAIL_URL object THUMBNAIL_URL Person's photo thumbnail URL, specified as a string. This URL must be fully qualified. Relative URLs will not work in gadgets. TIME_ZONE object TIME_ZONE Person's time zone, specified as the difference in minutes between Greenwich Mean Time (GMT) and the user's local time. See Date.getTimezoneOffset() in javascript for more details on this format. Container support for this field is OPTIONAL. TURN_OFFS object TURN_OFFS Person's turn offs, specified as an Array of strings. Container support for this field is OPTIONAL. TURN_ONS object TURN_ONS Person's turn ons, specified as an Array of strings. Container support for this field is OPTIONAL. TV_SHOWS object TV_SHOWS Person's favorite TV shows, specified as an Array of strings. Container support for this field is OPTIONAL. URLS object URLS URLs related to the person, their webpages, or feeds. Specified as an Array of opensocial.Url. Container support for this field is OPTIONAL. Back to top Class opensocial.Phone SUMMARY DETAIL Base interface for all phone objects. Method Summary String getField(key, opt_params) Gets data for this phone that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this phone that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Phone.Field Map. opt_params - Additional params to pass to the request. Returns: String The data Back to top Static Class opensocial.Phone.Field SUMMARY DETAIL All of the fields that a phone has. These are the supported keys for the Phone.getField() method. Field Summary object NUMBER The phone number, specified as a string. object TYPE The phone number type or label, specified as a string. Field Detail NUMBER object NUMBER The phone number, specified as a string. TYPE object TYPE The phone number type or label, specified as a string. Examples: work, my favorite store, my house, etc. Back to top Class opensocial.ResponseItem SUMMARY DETAIL Represents a response that was generated by processing a data request item on the server. Method Summary Object getData() Gets the response data. String getErrorCode() If the request had an error, returns the error code. String getErrorMessage() If the request had an error, returns the error message. opensocial.DataRequest getOriginalDataRequest() Returns the original data request. Boolean hadError() Returns true if there was an error in fetching this data from the server. Method Detail getData Object getData() Gets the response data. Returns: Object The requested value calculated by the server; the type of this value is defined by the type of request that was made getErrorCode String getErrorCode() If the request had an error, returns the error code. The error code can be container-specific or one of the values defined by Error. Returns: String The error code, or null if no error occurred getErrorMessage String getErrorMessage() If the request had an error, returns the error message. Returns: String A human-readable description of the error that occurred; can be null, even if an error occurred getOriginalDataRequest opensocial.DataRequest getOriginalDataRequest() Returns the original data request. Returns: opensocial.DataRequest The data request used to fetch this data response hadError Boolean hadError() Returns true if there was an error in fetching this data from the server. Returns: Boolean True if there was an error; otherwise, false Back to top Static Class opensocial.ResponseItem.Error SUMMARY DETAIL Error codes that a response item can return. Field Summary object BAD_REQUEST The request was invalid. object FORBIDDEN The gadget can never have access to the requested data. object INTERNAL_ERROR The request encountered an unexpected condition that prevented it from fulfilling the request. object LIMIT_EXCEEDED The gadget exceeded a quota on the request. object NOT_IMPLEMENTED This container does not support the request that was made. object UNAUTHORIZED The gadget does not have access to the requested data. Field Detail BAD_REQUEST object BAD_REQUEST The request was invalid. Example: 'max' was -1. FORBIDDEN object FORBIDDEN The gadget can never have access to the requested data. INTERNAL_ERROR object INTERNAL_ERROR The request encountered an unexpected condition that prevented it from fulfilling the request. LIMIT_EXCEEDED object LIMIT_EXCEEDED The gadget exceeded a quota on the request. Example quotas include a max number of calls per day, calls per user per day, calls within a certain time period and so forth. NOT_IMPLEMENTED object NOT_IMPLEMENTED This container does not support the request that was made. UNAUTHORIZED object UNAUTHORIZED The gadget does not have access to the requested data. To get access, use opensocial.requestPermission(). Back to top Class opensocial.Url SUMMARY DETAIL Base interface for all URL objects. Method Summary String getField(key, opt_params) Gets data for this URL that is associated with the specified key. Method Detail getField String getField(key, opt_params) Gets data for this URL that is associated with the specified key. Parameters: String key - The key to get data for; keys are defined in Url.Field Map. opt_params - Additional params to pass to the request. Returns: String The data Back to top Static Class opensocial.Url.Field SUMMARY DETAIL All of the fields that a URL has. These are the supported keys for the Url.getField() method. Field Summary object ADDRESS The address the URL points to, specified as a string. object LINK_TEXT The text of the link, specified as a string. object TYPE The URL number type or label, specified as a string. Field Detail ADDRESS object ADDRESS The address the URL points to, specified as a string. LINK_TEXT object LINK_TEXT The text of the link, specified as a string. TYPE object TYPE The URL number type or label, specified as a string. Examples: work, blog feed, website, etc.
Related docs
OpenSocial State of the Union
Views: 13738  |  Downloads: 41
OPENSOCIAL
Views: 0  |  Downloads: 0
Introduction to OpenSocial Apps Containers
Views: 332  |  Downloads: 15
OpenSocial State of the Union
Views: 14  |  Downloads: 0
A Beginner's Guide to OpenSocial
Views: 73  |  Downloads: 8
Using Google's GData API
Views: 147  |  Downloads: 0
Best Practices API's
Views: 1  |  Downloads: 0
Functional Design Specification
Views: 14  |  Downloads: 4
Other docs by Tara Sims
Chris Henry Police Report December 16 2009
Views: 7  |  Downloads: 0
Time Magazine Top 25 Blogs of 2009 Full List
Views: 11  |  Downloads: 0
The Summit Store Directory
Views: 8  |  Downloads: 0
The Summit Store Directory 2009
Views: 16  |  Downloads: 0
Itunes RSS Podcast Directory
Views: 15  |  Downloads: 0
Final 2009 BCS Bowl Standings Colleg Football
Views: 21  |  Downloads: 0
2009 UPS Year End Holiday Shipping Schedule
Views: 84  |  Downloads: 0
Lesson Plans Social Studies
Views: 7  |  Downloads: 1
Lesson Plans Science
Views: 3  |  Downloads: 0
Lesson Plans Plant Science
Views: 7  |  Downloads: 0
Lesson Plans Edible Science
Views: 12  |  Downloads: 0
Lesson Plans Dried Fruit Science
Views: 5  |  Downloads: 0