Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Thursday, February 10, 2011

Connect your Facebook friends in your application

The Basics:

Facebook application can be developed using the following methods
1.       XFBML.
2.       Javascript with calls to the Javascript client library.
3.       Code in any language, with calls to the Facebook REST API.

I have implemented the facebook with the help of Facebook REST API for selecting the friends from your login and posting the invitation to the wall, the invitation is a url for getting connected to my achieve street site.
FYI: The XFBML is going to be expired in January and will be out of scope, so you think twice before getting it implemented.

Configuring Connect Application
Integrating/developing an application with Facebook requires an API key and a secret key with whom Facebook will authenticate your application on Facebook platform - this is called oauthentication.
FYI:   OAuth: The simplest definition can be OAuth protocol enables users to provide third-party access to their web resources without sharing their passwords

How to Retrieve the API Key and Secret Key
1.       Navigate to Facebook developer center and request for new application which can be obtained from your facebook login.
  1. Choose an appropriate application name (My application's name is AchieveStreet).
  2. Navigate to basic tab, there you can see API key/ secret key is given.
  3. Provide a small description about your application.
  4. Navigate to connect tab. Provide the applications full.
  5. Navigate to Advanced tab and on Advanced Settings, choose web.
  6. Choose sendbox mode enable/disable. Enable allows only the developers of application to see it.
  7. Save your settings.
The sample application for the facebook connect can be found in

How to make connection with the Facebook and Posting into the wall
API’s needed:
Facebook.Web.dll, Facebook.dll

How to establish the connection with Facebook
Api api = new Api(connectAuthentication.CurrentSession);

Posting to the wall
api.Stream.Publish(strbody, null, null, target user id, source user id);
the userid is the unsigned long int.

For posting into the wall you need to give permission for the login user to write the message into wall below is the code for that to do from the application

function setGrandPermission(isRead, isPublish) {

    try {
        FB_RequireFeatures(["Api"], function () {

            //Allow Permission for accessing the friends
            var api = FB.Facebook.apiClient;

            FB.Connect.requireSession(function () {
                var session = api.get_session();

                api.users_hasAppPermission("read_stream", function (hasRead) {
                    api.users_hasAppPermission("publish_stream", function (hasPublish) {

                        var permissions = [];


                        if (isRead)
                            if (!hasRead) permissions.push("read_stream");

                        if (isPublish)
                            if (!hasPublish) permissions.push("publish_stream");


                        if (permissions.length > 0) {                        
                            FB.Connect.showPermissionDialog(permissions.join(","), function (authorized) {                            
                            });
                        }
                    });
                });
            });
        });
    }
    catch (err) {throw err.Message;}
}


Using JQuery facebook Multi-Friend Selection Plugin using Javascript API, Graph API

I would like to thank Thiru and Kumuraguru for helping me to know this topic.

The Javascript API is used to get connected with the Facebook to do more things on Javascript API, to know more on this visit

The Graph API to retrieve the friends list, to know more about Graph API visit

To know more about the facebook api's feel free to email me.

Monday, January 31, 2011

Basecamp API

What is Basecamp:
The basecamp API is project management tool where the project can be created along with the related documents can also be posted. The comments can also be posted for the particular project.

What is Basecamp API:
The Basecamp API is implemented as vanilla XML over HTTP using all four verbs (GET/POST/PUT/DELETE). Every resource, like Post, Comment, or TodoList, has their own URL and are manipulated in isolation.

For reference:

My Experience
I have used the Basecamp API in one of my project named http://www.sluiceit.com/ which is a requirement management tool for projects, the sluiceit will integrate the Basecamp with the help of the basecamp API  the completed projects is exported to the existing project or with the help of the new project in the basecamp with the help of the API token. The completed requirments are transferred to the basecamp in the form of message along with their corresponding documents as well.
In the sluiceit.com only the clientAdmin and the projectAdmin have the rights to export the project into the basecamp.
For more information on how it is designed in the sluiceit.com, and the samples related to how to upload a document, create a message, todolist, milestones. You can e-mail me to gmail .