Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
    • Graph API
    • FQL
    • Open Graph
    • Dialogs
    • Chat
    • Internationalization
    • Ads
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • JavaScript
  • PHP
  • More SDKs
  • Dialogs
    • Add Page Tab Dialog
    • Feed Dialog
    • Friends Dialog
    • OAuth Dialog
    • Pay Dialog
    • Requests Dialog
    • Send Dialog

Friends Dialog

Facebook APIs › Dialogs › Friends Dialog

Prompt the user to add a friend. If the friend had previously sent a request to the user, then the dialog allows the user to confirm the friend instead of sending a new friend request.

Properties

app_id

Your application's identifier. Required, but automatically specified by most SDKs.

redirect_uri

The URL to redirect to after the user clicks a button on the dialog. Required, but automatically specified by most SDKs.

display

The display mode in which to render the dialog. The default is page on the www subdomain and wap on the m subdomain. This is automatically specified by most SDKs.

id

Required. The ID or username of the target user to add as a friend.

Return Data

action

A boolean that is set to 1 if the friend was added, and 0 otherwise.

Usage Notes

This feature is intended to help users become friends on Facebook with people that they are connected to in real life. You should not use this feature to encourage users to friend other users that they are not connected to in real life. If your app is found to be encouraging this behavior, your usage of this feature may be disabled.

Example

Direct the user's browser to

http://www.facebook.com/dialog/friends/?
  id=brent&
  app_id=123050457758183&
  redirect_uri=http://www.example.com/response/

Click here to try the URL yourself. The user will see a dialog that looks like the following:

Friends dialog

If the user clicks "Add Friend", the browser will redirect to

http://www.example.com/response/?action=1

If the user clicks "Cancel", the browser will redirect to

http://www.example.com/response/?action=0
Updated over a year ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy