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

Send Dialog

Facebook APIs › Dialogs › Send Dialog

Overview

The Send Dialog lets people to send content to specific friends. They’ll have the option to privately share a link as a Facebook message, Group post or email.

You should specify a URL, and you can pre-populate a user in the ‘to’ field. The Send Dialog does not require any extended permissions. This Dialog is currently not supported on mobile devices.

Note: Facebook messages is a channel for user-to-user communication, and not for applications to send messages to their users, or encourage users to spam their friends. In general, applications on Facebook should use Requests when communicating in game status (its your turn), inviting people to use an application, or sending messages to multiple people. You should offer the Send Dialog in situations when a user might otherwise send an email.

JavaScript Example

You can load the same Send Dialog URL using the Facebook JavaScript SDK:

<html xmlns:fb="http://www.facebook.com/2008/fbml">
  <body>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <div id="fb-root"></div>
    <script>
      // assume we are already logged in
      FB.init({appId: '123050457758183', xfbml: true, cookie: true});

      FB.ui({
          method: 'send',
          name: 'People Argue Just to Win',
          link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html',
          });
     </script>
  </body>
</html>

This loads the URL in this example in an iframe.

Direct URL Example

Direct the user's browser to:

http://www.facebook.com/dialog/send?app_id=123050457758183&
name=People%20Argue%20Just%20to%20Win&
link=http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html&
redirect_uri=https://www.bancsabadell.com/cs/Satellite/SabAtl/

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

If the user clicks either button ("Send" or "Cancel"), the browser will redirect to

http://www.example.com/response

The message will look like this in the recipient's inbox:

If sending the message is successful, the user will be redirected to the redirect_uri. Otherwise, an error will be shown. Unlike the Like Button, there is no return value per se.

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 the Send or Cancel buttons on the dialog. Required, but automatically specified by most SDKs. Specify redirect_uri ONLY for the page mode display type, where we have no callback. If you are using FB.ui - use callback function to handle the result.

display

The display mode in which to render the dialog. This is automatically specified by most SDKs.

to

A user ID or username to which to send the message. Once the dialog comes up, the user can specify additional users, Facebook groups, and email addresses to which to send the message. Sending content to a Facebook group will post it to the group's wall.

link

(required) The link to send in the message.

picture

By default a picture will be taken from the link specified. The URL of a picture to include in the message. The picture will be shown next to the link.

name

By default a title will be taken from the link specified. The name of the link, i.e. the text to display that the user will click on.

description

By default a description will be taken from the link specified. Descriptive text to show below the link.

Return Data

The full documentation and more examples are available in on our Platform Dialog reference page.

Updated about 4 months ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy