OCLC Developer Network

OpenSocial AppData

AppData can be used by gadget developers to store and retrieve information input by a particular user. This is typically not information for gadget personalization but rather user data that could be shared across gadgets. OCLC reccomends that AppData be used to store API key information.

Unlike UserPrefs, AppData is not defined via gadget XML elements. Instead AppData can be interacted with via the osapi.appdata service object of the AppData service.

osapi.appdata

osapi.appdata can be used to perform both read and write operations on AppData. This object supports the following methods and parameters

  • get - retrieves information from the AppData service
    • userId
    • groupId
    • keys
  • update - updates information stored in the AppData service
    • userId
    • groupId
    • data
  • delete - deletes information stored in the AppData service
    • userId
    • groupId
    • keys

Example

osapi.appdata.get({userId: '@viewer', groupId: '@friends', keys: ['gifts']}).execute(myGetCallback);

 

Data Pipelining

AppData can also be access via DataPipelining

<os:DataRequest>

Example

<Data>
<os:DataRequest key="apikey" method="appdata.get" userId="viewer" fields="nyt_key"/>
</Data>


Example

<os:PersonAppDataRequest key="" userId="@viewer" fields="" appId=""/>

Follow the OCLC Developer Network:

The OCLC Developer Network supports the use of OCLC Web Services—a set of tools and APIs that expose data and services for WorldCat and our member libraries and partner institutions or companies. learn more »

© 2010 OCLC Domestic and international trademarks and/or service marks of OCLC Online Computer Library Center, Inc. and its affiliates


Powered by Drupal, an open source content management system