Developer / Documentation / Netlog OpenSocial REST API
The REST API allows a developer to retrieve pieces of information about a user by sending a HttpRequest to our server.
First of all, you need to make yourself known to our REST server so it knows you and your relation to the people you want to retrieve information from.
Inside the gadget, you can retrieve the token by doing the following in javascript:
var token = shindig.auth.getSecurityToken();Once you get the security-token, you can proceed on doing your requests.
An example of an URL fetching the friends of a specific user:
http://nl.api.netlog.com/opensocial/social/rest/people/31576831/@friends?format=xml&st=NTVkYmIxYWI4NDcyYWZjMDJjMWI2NmY4MTEwMzE0OWU=
The default output format is JSON, however if you specify format= in your query, the output will be returned in the desired format.
Our REST API is capable of returning the data in 3 kinds of formats:
- XML
- JSON
- ATOM
Possible actions
| Type | URI | Description |
|---|---|---|
| People |
|
|
| Activities |
|
|
| Appdata |
|
|
Possible query parameters
| Parameter | Description |
|---|---|
| count={value} |
If you specify this parameter, our container will only return the x amount of results you want. If a request ends up generating 30 results, and you only want to retrieve 10 of them, use this parameter. |
| filterBy={value} | Returns items from a collection, filtered by the given field. We currently only support topFriends. |
| filterOp={value} | The operation to use when filtering a collection. At this time we only support "contains" |
| filterValue={value} | The value to use when filtering a collection. |
| format={value} | Format desired. Pick between ATOM, JSON or XML. Default is JSON if not provided. |
| fields={value} | List of the fields you want to include in the resultset. If no fields are provided, we will return the userid and profileUrl. If you want to specify multiple fields, please a comma as delimiter.
http://nl.api.netlog.com/opensocial/social/rest/people/ |
| sortBy={value} | For a collection, return entries sorted by the given field. Currently we only support sorting by displayName and topFriends. |
| sortOrder={value} | Can either be "ascending" or "descending", defaults to ascending. Used to sort objects in a collection. |
| startIndex={value} | Starts displaying the results starting from startIndex. For example, if the request returns 30 items, but you only want the last 10, you would specify a startIndex of 20. |
Some examples
Fetch information about myself
http://nl.api.netlog.com/opensocial/social/rest/people/@me/@self?st=OTI3MTM3ODdjNTgwMjJlOGE0MGFiZDc4OTllMzM3MzI=&fields=id,status,thumbnailUrl
Will fetch info about the requester (the logged in user).
Will only return the fields id, status and thumbnailUrl.
http://nl.api.netlog.com/opensocial/social/rest/people/@me/@friends?st=OTI3MTM3ODdjNTgwMjJlOGE0MGFiZDc4OTllMzM3MzI=&fields=profileUrl,displayName
Will fetch info about the friends of the requester (the logged in user).
Will only return the fields profileUrl and displayName.
http://nl.api.netlog.com/opensocial/social/rest/activities/57854631/@self?st=NTQyZWY0NDAyNGE2OTQ4ZDc5NWUwY2I1OWM5NzAwZDg=
Will return all the activities (20 items per page default) for the given user (user with userId 57854631 in this example).
Should you require more information about REST in OpenSocial, please visit the official REST documentation
Articles
- Introduction
- Application Guidelines
- OpenSocial
- Netlog REST API (depricated)
- Flash Applications (depricated)
- PHP Applications (depricated)
- Syndication (feeds)
- Widgets: Link, blog or shout
- Bookmarklets: link, blog or shout
- Terms & Conditions