Person Data Extraction Methods

The helper methods defined for extracting Person data are:

  • opensocial.Person.getAppData

  • opensocial.Person.getDisplayName

  • opensocial.Person.getField

  • opensocial.Person.getId

  • opensocial.Person.isOwner

  • opensocial.Person.isViewer

The OpenSocial specification includes a number of alternate, streamlined methods for capturing a lot of the same social data you would through the aforementioned methods. These are embedded within the lightweight JavaScript API references.

Each method listed in the following sections supports several parameters, which are used to specify the data to be returned by the REST request to the container’s social endpoints.

osapi.people.get

get is the generic call within the lightweight JavaScript API methods to collect a user’s data, and can be used to retrieve most of the social details you will want to leverage.

The osapi.people.get(...) method accepts a JSON object to define the type of information you want, and takes the form:

osapi.people.get(params)

Parameter list

The params list may consist of:

auth (AuthToken)

An optional authorization token for requesting data.

Example value: HttpRequest.Authorization

userId (string or array of strings)

A string or array of strings that defines the user about whom you want to collect data. You may use short identifiers such as @me, @viewer, or @owner.

Example value: '@owner' or ['@me', '@owner']

groupId (string)

A string defining a group of people about whom you want to collect data. This value is especially useful ...

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.