As you may have noticed, hi5 has undergone some changes lately. We're refocusing on the social entertainment market. You may have noticed the new hi5 games section and our new virtual currency -- hi5 coins. There are some great new opportunities in this space for the platform, but first
The News.
New Platform Features
There have been a number of changes since our last blog post months ago. Here's a quick rundown of what's now available:
Full Portable Contacts and Opensocial REST support.
hi5 always had some great REST support, we've had FOAF and Atom support from the start. We now fully support
Portable Contacts and
OpenSocial REST APIs. These APIs allow external applications to access much more friend data. New Fields that we support include:
- About Me
- Addresses (Partner Only)
- Books
- Emails (Partners Only)
- Ethnicity
- IMs (Partner Only)
- Interests
- Languages Spoken
- Looking For
- Movies
- Music
- Phone Numbers
- Relationship Status
- Religion
- TV Shows
This is all in addition to our existing set of supported fields including Status, Gender, Birthday, Name and profile photos. All of these obey the hi5 privacy settings. Generally this means if data is public we will return it, if it's friends only we'll return it if both users have the same application. Some sensitive data we are currently only offering to Partners that are willing to align privacy policies. Contact platform-help@hi5.com for more details.
Here are some examples with public data to get you started:
http://api.hi5.com/social/rest/people/87628233/@self
http://api.hi5.com/social/rest/people/87628233/@self?format=xml
http://api.hi5.com/social/rest/people/87628233/@self?format=atom
http://api.hi5.com/social/rest/people/87628233/@self?fields=name,interests,aboutMe,status
http://api.hi5.com/social/rest/people/87628233/@self?filterBy=topFriends
Opensocial 0.9 -- Messaging APIs and more!
The
Opensocial 0.9 specification was recently approved. At hi5 we played a major part in this process, including submitting a new Opensocial Messaging API. The messaging API allows for access to all the different types of hi5 messages via REST. You'll find support for public messages (profile comments), private messages (inbox and bulk), sent messages, friend requests, photo comments, and notifications. Depending on the privacy settings your app can access this data. You can easily get an overview of all messages collections with their total and new message count. For partner applications we also allow adding messages, accepting friend requests, marking messages as read and deleting messages.
In addition to this we've already implemented a number of the items for 0.9 in draft format for the hi5 container. You can access these by requiring the feature "opensocial-0.9" in your XML definition file. Note that some of these new features may be unstable. Some great new 0.9 features that you can try are:
- New and improved Lightweight Javascript API
- Templates and OSML
- Simplified App Data APIs
OAuth Support
For some time hi5 has allowed access to our APIs with a Hi5AuthToken cookie or an st parameter on the query string. There's now a better way to do this, OAuth. We now support both two-legged OAuth and three-legged OAuth. This means you don't have to squirrel away tokens and use custom calling code. Instead you can just use OAuth.
Two-Legged OAuth support is available in many of the popular
OpenSocial REST libraries. It relies upon the user authorizing your application in hi5 prior to you making a request. To ascertain this is fairly easy, just use a "makeRequest" call to send the userid to your backend server.
Three-legged OAuth is more complex, but allows you to authorize access directly from your remote web site, desktop client or mobile client. In this case you configure your software to request a token, you then direct the user to an authorization page and then control is returned to your software.
To use OAuth you need to know the following important pieces of information:
- Consumer Key: Use your application ID, which is a number
- Consumer Secret: Use the hi5 API key
- Request Token URL: https://api.hi5.com/oauth/requestToken
- Authorize URL: https://login.hi5.com/oauth/authorize
- Access Token URL: https://api.hi5.com/oauth/accessToken
Once you've authenticated you can then make requests to http://api.hi5.com/social/rest/* endpoints with ease.
The Future
There are a number of exciting features coming to the hi5 platform in the future, especially as it relates to our new Social Entertainment focus. One of the first new features we will support is an OpenSocial-based
Virtual Currency API. This will allow OpenSocial Applications to redeem hi5 coins and open up a new monetization channel. And since it's an open standard your redemption code will work on hi5, 51.com and other containers that implement the specification. Currently we are working through a beta test with selected partners. Stay tuned for more on this initiative and other APIs relating to Social Entertainment.
Leave a comment