Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 564923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:49:03+00:00 2026-05-13T12:49:03+00:00

Starting from this very nice article about doing facebook integration using the javascript API

  • 0

Starting from this very nice article about doing facebook integration using the javascript API, I was able to successfully make several calls against the FB.Connect namespace.

I am now interested in calls that are in the FB.ApiClient library, and have tried a few simple ones. I cannot get this to work, is there something I have to do that different?
Specifically, I would like to make calls against the events_get methods.

Documentation:

  • Facebook JavaScript API
  • streamPublish (working well!)
  • events_get (method I would really
    like to get working)

Code:

Working JavaScript:

    function updateStatus() {
        FB.Connect.streamPublish();
    }

Error: FB.ApiClient.get_apiKey is not a function

    function getEventInfo() {
        FB.ApiClient.get_apiKey();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:49:03+00:00Added an answer on May 13, 2026 at 12:49 pm

    the namespace and methods are inconsistent in the way that they are named and used. To access the apiClient, you must use FB.Facebook.apiClient.

    In short. Instead of calling:

    FB.apiClient.get_apiKey();
    

    call:

    FB.Facebook.apiClient.get_apiKey();
    

    Below, I have included a complete example, where I worked out several methods on the Connect and ApiClient APIs. This is working as of 1/22/09.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <body>
    <a target="_blank" href="http://developers.facebook.com/docs/?u=facebook.jslib">Facebook JavaScript API Documentation</a>
    <div id="comments_post">
        <h3>Post a comment to your Facebook Feed:</h3>
    
        Demonstration to show what can be done with Facebook Connect, using the javascript API
    
        <form name="comment_form" method="POST">
            <div id="user">
                Name: <input name="name" size="27"><br />
                <fb:login-button length='long' onlogin="update_user_box();"></fb:login-button>
            </div>
    
            <br /><textarea name="comment" rows="5" cols="30"></textarea>
    
            <br /><input type="button" onclick="submit_comment();" value="Submit Comment">
            <br /><input type="button" onclick="updateStatus();" value="updateStatus">
            <br /><input type="button" onclick="updateStatusWithImage();" value="updateStatusWithImage">
            <br /><input type="button" onclick="postToFriendsWall();" value="postToFriendsWall">
            <br /><input type="button" onclick="postAnImage();" value="postAnImage">
            <br /><input type="button" onclick="alert(FB.Connect.get_loggedInUser());" value="get logged in user id">
            <br /><input type="button" onclick="getFriends()" value="get friends">
            <br /><input type="button" onclick="getEventMembers()" value="get event members">
            <br /><input type="button" onclick="getEventInfo()" value="get event info">
    
            <div id="profile_pics"></div>
    
        </form>
    </div>
    
    <script type="text/javascript">
        function update_user_box() {
            var user_box = document.getElementById("user");
    
            user_box.innerHTML =
                "<span>"
                + "<fb:profile-pic uid='loggedinuser' facebook-logo='true'></fb:profile-pic>"
                + "Welcome, <fb:name uid='loggedinuser' useyou='false'></fb:name>"
                + "</span>";
    
            FB.XFBML.Host.parseDomTree();
        }
    
        function update_user_not() {
        }
    
        function submit_comment() {
    
            comment_text = document.getElementsByName("comment")[0].value;
    
            var template_var = { "post-title": "pakt.com",
                "post-url": "http://www.pakt.com/pakt/?id=ce00f49ed79e17aa&t=How_to_add_Facebook_Connect_to_your_website",
                "comment-text": comment_text,
                "images": [{ "src": "http://images.pakt.com/images/user/chris/thumb_chris_5df0eb914796c68.jpg", "href": "http://www.pakt.com/pakt/?id=ce00f49ed79e17aa&t=How_to_add_Facebook_Connect_to_your_website"}]
            };
    
            FB.Connect.streamPublish(comment_text);
        }
    
        function ClearComments() {
            document.getElementsByName("comment")[0].value = "";
        }
    
        function updateStatus() {
            FB.Connect.streamPublish();
        }
        var attachment = { 'media': [{ 'type': 'image',
            'src': 'http://bit.ly/AJTnf',
            'href': 'http://bit.ly/hifZk'}]
        };
        function updateStatusWithImage() {
    
            FB.Connect.streamPublish('', attachment);
        }
    
        function postToFriendsWall() {
    
    
            FB.Connect.streamPublish('enjoying the Facebook javascript API much better than other versions', attachment, null, 1578234238);
        }
    
        function postAnImage() {
            function stream_callback(post_id, exception) {
                if (post_id) {
                    post_to_my_server(post_id);
                }
            }
    
            FB.Connect.streamPublish('', attachment, null, null,
                         'What do you think?',
                         stream_callback);
        }
    
        function getLoggedInUser() {
            var id = FB.Connect.get_loggedInUser();
            alert(id);
        }
    
        function getFriends() {
            var widget_div = document.getElementById("profile_pics");
            FB.ensureInit(function() {
    
                FB.Facebook.apiClient.friends_get(null, function(result) {
                    var markup = "";
                    var num_friends = result ? Math.min(10, result.length) : 0;
                    if (num_friends > 0) {
                        for (var i = 0; i < num_friends; i++) {
                            markup +=
                       '<fb:profile-pic size="square" uid="'
                       + result[i]
                       + '" facebook-logo="true">'
                       + ' </fb:profile-pic>';
                        }
                    }
                    widget_div.innerHTML = markup;
                    FB.XFBML.Host.parseDomElement(widget_div);
                }); //end of friends_get
            }); //end of ensureInit
        }
    
        function getEventMembers() {
            var widget_div = document.getElementById("profile_pics");
            FB.ensureInit(function() {
    
                FB.Facebook.apiClient.events_getMembers(53288226963, function(result) {
                    var markup = "";
                    var num_friends = result ? Math.min(10, result.attending.length) : 0;
                    if (num_friends > 0) {
                        for (var i = 0; i < num_friends; i++) {
                            markup +=
                       '<fb:profile-pic size="square" uid="'
                       + result.attending[i]
                       + '" facebook-logo="true">'
                       + ' </fb:profile-pic>';
                        }
                    }
                    widget_div.innerHTML = markup;
                    FB.XFBML.Host.parseDomElement(widget_div);
                }); //end of friends_get
            }); //end of ensureInit
        }
    
        //this one doesn't work. don't know why yet.
        function getEventInfo() {
            var widget_div = document.getElementById("profile_pics");
            var eids = new Array();
            eids.push(53288226963);
    
            FB.Facebook.apiClient.events_get('', eids, 0, 0, 'attending', function(result) {
                var markup = "";
                var num_friends = result ? Math.min(10, result.attending.length) : 0;
                if (num_friends > 0) {
                    for (var i = 0; i < num_friends; i++) {
                        markup +=
                       '<fb:profile-pic size="square" uid="'
                       + result.attending[i]
                       + '" facebook-logo="true">'
                       + ' </fb:profile-pic>';
                    }
                }
                widget_div.innerHTML = markup;
                FB.XFBML.Host.parseDomElement(widget_div);
            }); //end of friends_get
    
        }
    </script>
    <script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" mce_src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"> </script>
    <script type="text/javascript">
        var api_key = "de57fdca3c665931e2a6b411f90a1cb4";
        var channel_path = "xd_receiver.htm";
        FB.init(api_key, channel_path, { "ifUserConnected": update_user_box });
    </script>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 381k
  • Answers 381k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm assuming that (a,b,c) is unique. One way to do… May 14, 2026 at 10:03 pm
  • Editorial Team
    Editorial Team added an answer you need to put def action_name output = `/path/to/your/shell/script` end… May 14, 2026 at 10:03 pm
  • Editorial Team
    Editorial Team added an answer Seems like a very reasonable approach. Personally I'd go with… May 14, 2026 at 10:03 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.