An Application Programming Interface (API) is an interface implemented by a software program. They can be executed by applications, libraries, and operating systems. Purpose of APIs is to determine the vocabulary and calling conventions. Thus may include routines, data structures,object classes and protocols used to communicate between the consumer and implementer. Programmer must employ them for coding.
APIs are used in Object oriented languages for sharing the content. OpenSocial of Google concentrates on using normal java script.
Three set of common APIs are defined by Google Inputs will be received from partners Developers can access core functions and information on social networks.
- User data as provided by the profile information
- Friends information that is social graph
- Activities such as news , general information
Hosts will accept the API calls ands return appropriate data. Google gives coverage for common uses.
Specialized functions/data can be accesses from the hosts via their own APIs.
The API s are created with a greater amount of flexibility.
- Core API server -For containers that wish to expose data in a standard way though web services.
- Core gadget server-For containers that simply want to be able to render gadgets(miniature objects that offer dynamic content).
- Social API Server-For containers that wish to expose social data through standard web services that are consistent across containers.
- Social Gadget Server-For containers that want to render gadgets and provide them access standard social data.
All data definitions will be consolidated into core data spec and Social data spec. Separate files will be created for each of the four compliance models.
This very basic widget lets us see the main characteristics of an UWA widget:
- It’s an XHTML file ;
<meta>is used for meta information (about the widget, the author, etc.) ;
- this is also where your declare the OpenSocial version you wish to us.
<head>also contains the scripting and styling tags, respectively in the usual
<body>is the main container node – this is where the widget HTML code goes ;
In order to work with the OpenSocial API, you need to add the following meta tag:
<meta name="opensocial" content="0.8" />
You may choose any version the OpenSocial API, from 0.6 to 0.8.