Friendster Developers Platform
fbOpen Getting Started Guide
This step-by-step guide describes how to create an app with the Facebook compatible fbOpen platform. You will need a web site to host your server side app.
Supported features
Friendster supports FBML, FQL and FBJS as detailed in this section.
FBML Tags:
API Calls:
| Category | API Call |
|---|---|
| Authentication | auth.createToken, auth.createSession |
| Profile | profile.setFBML, profile.getFBML |
| FQL | fql.query |
| Users | users.getInfo, users.getLoggedInUser, users.isAppAdded, users.hasAppPermission, users.setStatus |
| Friends | friends.getAppUsers, friends.get, friends.areFriends |
| Notifications | notifications.send, notifications.get |
| FBML | fbml.setRefHandle, fbml.refreshRefUrl, fbml.refreshImgSrc |
| Photos | photos.createAlbum, photos.getAlbums, photos.upload, photos.get |
These APIs can be accessed at the endpoint http://api.friendster.com/v2/restserver.php.
The feed API is coming soon, the feed.publishUserAction and feed.registerTemplateBundle calls currently return success with no data so that you do not need to remove these calls from your application.
FQL Tables:
| Table Name | Fields |
|---|---|
| user | uid, name, first_name, last_name, sex, birthday, pic_big, pic, pic_square, pic_small, profile_url, interests, music, tv, movies, books, about_me, profile_update_time, current_location, meeting_sex, meeting_for, relationship_status, is_app_user, wall_count, status, hs_info, timezone, affiliations |
| friend | uid1, uid2 |
FBJS:
FBJS DOM Objects, Events, AJAX and Dialogs are supported.
Creating and Registering your fbOpen app
You can create and register a simple PHP app using FBML by following these steps:
1. Include in your code the Facebook API library from here .
2. Go to www.friendster.com/developer and click on the 'Get API Key' link.
3. Enter the app name and the Callback URL to your server side app as shown here, then choose 'Use FBML'.
4. After you click on the 'Save' button you should see your app listed on Manage Apps.
5. Update your app with the Api Key and Secret listed there. You can then run it by clicking on 'Test App'.
Submitting your App to the App Directory
Once your app is fully tested, you can click on 'Submit to app directory' to make it visible to all Friendster users. The following information must be valid:
| App Display Name | The name of the app as it appears in the App Directory and the Add App page. |
|---|---|
| Canvas Type | FBML or IFrame. |
| Description | The Description of the app shown in the App Directory and the Add App page. |
| Directory Icon | The image displayed in the App Directory and the Add App page. The standard size is 75px * 75px. |
| Tiny Icon | The image displayed in the My Apps page. The standard size is 16px * 16px. |
| App Name (optional) | The app name used in the app's Canvas URL, with the format: '<http://apps.friendster.com/><app_name>'. |
| Callback URL | The Callback URL called by Friendster after a successful login or from the app's Canvas URL. Login is used in case of an external web application requiring Friendster authentication. |
| Install URL (optional) | The Install URL called by Friendster when adding the app. |
| Uninstall URL (optional) | The Uninstall URL called by Friendster when user removes the app. |
| Default Content (optional) | Default html or javascript profile content for the app. |
| Administrative Email | Email address that Friendster can contact for important updates or issues. |
Sample Code
To run this sample app just substitute your api key and secret and make this file accessible through the Callback URL.
<?php
require_once 'friendster.php';
$appapikey = '<ENTER YOUR API KEY HERE>';
$appsecret = '<ENTER YOUR SECRET KEY HERE>';
$friendster = new Friendster($appapikey, $appsecret);
$user_id = $friendster ->require_login();
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Friends:";
$friends = $friendster ->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
echo "
$friend";
}
echo "</p>";
Integration points within the Friendster website
The following are the current integration points within the Friendster website:
| App Directory | Apps are placed in the App Directory by categories. Friendster users can explore these widgets/applications and add them to their profile. |
|---|---|
| Add App Page | The Add App page displays the app thumbnail and description as well as Friendster's Terms of Service. It prompts for user confimation after the user selects an app from the App Directory. User can choose to invite all their friends to add the application. |
| User Profile | Every app gets a module in the profile page and can control its content. The chrome of the module includes support for Grabbing apps from someone else's profile to your own etc. |
| App Canvas Page | The App Canvas page opens from the 'edit' button on a app's chrome in the user profile page, or from the app Canvas URL. |
| Tracker | A new event is added to user's network activity when an app is added by the user. |
| Pending App Invitations | "NEW app invitations" appears in user's My Inbox when they receive app invitations from their friends. User can select it to view all their app invitations. |
| Pending App Notifications | "NEW app notifications" appears in user's My Inbox when they receive app notifications from applications they've installed. User can select it to view all their app notifications. |