Graph:Link

From Facebook Developer Wiki (FbDevWiki.com)
Jump to: navigation, search

A link shared on a user's wall

Contents

Example

https://graph.facebook.com/114961875194024 (A link shared by Arjun Banker)

Properties

Name Description Permissions Returns Condition
id The link ID Publicly accessible A JSON string
from The user that created the link Publicly accessible A JSON object containing the id and name field
link The URL that was shared Publicly accessible A JSON string containing a valid URL
name The name of the link Publicly accessible A JSON string
caption The caption of the link (appears beneath the link name) Publicly accessible A JSON string
description A description of the link (appears beneath the link caption) Publicly accessible A JSON string
icon A URL to the link icon that Facebook displays in the news feed Publicly accessible A JSON string containing a valid URL
picture A URL to the thumbnail image used in the link post Publicly accessible A JSON string containing a valid URL
message The optional message from the user about this link Publicly accessible A JSON string
created_time The time the message was published Publicly accessible A JSON string containing a IETF RFC 3339 datetime

Connections

Name Description Permissions Returns
comments All of the comments on this link Publicly available An array of JSON objects containing id, from, message and created_time fields

Publishing

Requires the publish_stream permission.

To publish a wall post, POST the link, (optional) name, (optional) caption, (optional) description and (optional) message to the feed/wall of the user or Page.

curl -F 'access_token=...' \
     -F 'link=http://www.example.com/article.html' \
     -F 'picture=http://www.example.com/article-thumbnail.jpg' \
     -F 'name=Article Title' \
     -F 'caption=Caption for the link' \
     -F 'description=Longer description of the link' \
     https://graph.facebook.com/me/feed

Notes/Bugs/Gotchas

a developer comment in the docs:

"From some initial trail-and-error, the /links endpoint seems to only respect the link (and message?) parameters, using it's own name/description/caption. The /links endpoint also doesn't mention the app that posted the update; it also does not grab an icon from the page (like sharing via the web interface does).

When sharing a blogspot link in any manner, the description field seems to be filled in with text from the comments, rather than the post itself."

This has been reported in bugzilla as a bug

Personal tools
Namespaces
Variants
Actions
Navigation
Graph API
FQL
Toolbox