Adding the Buddy List Widget to your Page

Using the Web AIM API with its basic functionality is extremely simple. The following steps will get you on your way to having a buddy list on your page:

  1. Visit http://developer.aim.com/manageKeys.jsp and grab an API key.
  2. Once you have your key, place an element in your web page (preferably a <div>) and give it an id attribute of AIMBuddyListContainer.
  3. Give the AIMBuddyListContainer element an attribute named wim_key and paste your API key in as its value. Your markup should look like this:
    <div id="AIMBuddyListContainer" wim_key="asd32twe3vka_l15"></div>

    Note: If you're a stickler for validation and the thought of adding the wim_key attribute to your page causes you chills, you can always define it in JavaScript as AIM.params.wimKey.

  4. Paste this line of code between the <head> and </head> elements on your page:
    <script type="text/javascript" src="http://o.aolcdn.com/aim/web-aim/aimapi.js"></script>
  5. Add a link on your page like this:
    <a onclick="AIM.widgets.buddyList.launch();return false;" href="nojavascript.html">Launch my Buddy List</a>

That's it! Now you've got your own AIM client running on your web page.

Note: The "nojavascript.html" page will only be hit by people that visit your application with JavaScript disabled, and it is up to you to create for your site. It is not required, but it is a usability enhancement that will make you many friends in the accessibility community.