function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chirag MehtaChirag Mehta 

Salesforce to Facebook: How to call and connect to Facebook from Apex

Facebook toolkit was published for Salesforce.  Using that toolkit its possible to connect Facebook right inside from Salesforce.  I am trying to make a Apex to Facebook API call to fetch in groups related to my facebook id using following snippet

FacebookSession fbsession= new FacebookSession(appKey,appSecret,'','');
List<IFacebookQueryResult> groups = fbsession.query('Select name, venue, gid FROM group WHERE gid IN (SELECT gid FROM group_member WHERE uid = \'11111111111\')');

It throws following error
<error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <error_code>102</error_code> <error_msg>Session key invalid or no longer valid: </error_msg> <request_args list="true">

To my knowledge before instantiating FacebookSession Class,I need to fetch session id and set it as 4th parameter of FacebookSession constructor.Can someone guide me how to fetch session id or is there anything else i am missing .

Samples or Examples depicting salesforce-facebook connection will be really appreciated!
aalbertaalbert

This link provides a walkthrough on Using the Force Toolkit for Facebook

 

 

Chirag MehtaChirag Mehta

@aalbert - Thanks !

 

Obviously the article pointed by you is the first step of using facebook toolkit. I installed and navigated to FBToolkitPage, it doesnt work. It comes out with a blank page.

 

Fyi, the same error have already been posted by many of the developers on the community. Following are few of the references

http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=27759&query.id=176503#M27759

 

Also see a note from the developer of facebook toolkit stating about this issue

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=6492&query.id=176511#M6492 

 

So can anyone help me to connect.... successfully connect .... to Facebook from Apex. 

 

rpolisettirpolisetti

Hi all,

 

Has any one managed to successfully connect to Face book. I am getting a blank page when I used the very first version that they put up on google code.

 

The documentation is a mess. They do not maintain version specific docs out there.

 

Thanks,

Venkat

cloudmaniacloudmania

i managed to connect facebook.It depends on your facebook apps configuraiton.Add force.com url to ur facebook app.

buchi Boggavarapubuchi Boggavarapu
can anyone give code for salesforce to facebook integration code.