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:

  1. XML
  2. JSON
  3. ATOM

Possible actions

Type URI Description
People
  1. /people/{guid}/@all
  2. /people/{guid}/@friends
  3. /people/{guid}/{groupid}
  4. /people/{guid}/@all/{pid}
  5. /people/{guid}/@self
  6. /people/@me/@self
  1. Collection of all people connected to user {guid}
  2. Collection of all friends of user {guid}, a subset of @all
  3. Collection of all people connected to user {guid} in group {groupid}
  4. Individual person record for a specific person known to {guid}
  5. Profile record for user {guid}
  6. Profile record for the person requesting the data
Activities
  1. /activities/{guid}/@self
  2. /activities/{guid}/@friends
  3. /activities/{guid}/{groupid}
  4. /activities/{guid}/@self/{activityid}
  1. Collection of activities generated by given user
  2. Collection of activities for friends of the given user {guid}
  3. Collection of activities for people in group {groupid} belonging to given user {uid}
  4. Individual activity resource; usually discovered from collection
Appdata
  1. /appdata/{guid}/@self/{appid}
  2. /appdata/{guid}/@friends/{appid}
  3. /appdata/{guid}/@self/{appid}?fields=count
  1. All app data for user {guid}, app {appid}
  2. All app data for friends of user {guid} and app {appid}; read-only (only GET and HEAD supported)
  3. The count field for user {guid}, app {appid}

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.

  • id
  • age
  • thumbnailUrl
  • profileUrl
  • birthday
  • gender
  • interests
  • languagesSpoken
  • relationshipStatus
  • sexualOrientation
  • tags
  • networkPresence
  • aboutMe
  • nickname
  • displayName
  • addresses
  • jobs
  • photos
  • lookingFor
  • music
  • schools
  • urls
Example:
 http://nl.api.netlog.com/opensocial/social/rest/people/
userid/@friends?st=ST=&fields=status,thumbnailUrl
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.

Fetch information about my friends
 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.

Fetch all activities created by a user.
 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