Graph:Post

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

An individual entry in a profile's feed. The read_stream extended permission is required to access any information in a profile's feed that is not shared with everyone.

Contents

Example

https://graph.facebook.com/19292868552_118464504835613 (A post from Facebook Platform)

Properties

Name Description Permissions Returns Condition
id The post ID read_stream JSON string
likes likes on this post Available to everyone on Facebook JSON object containing count (a total count of likes) and may also have data which contains an array of a few people who liked this post
from Information about the user who posted the message read_stream A JSON object containing the name and Facebook id of the user who posted the message (I've seen posts with no 'from', perhaps from the author being deleted)
to Profiles mentioned or targeted in this post read_stream Contains in data a list of JSON objects, each with the name and Facebook id of the user
message The message read_stream JSON string
picture If available, a link to the picture included with this post read_stream JSON string containing the URL
link The link attached to this post read_stream JSON string containing the URL
name The name of the link read_stream JSON string
caption The caption of the link (appears beneath the link name) read_stream JSON string
description A description of the link (appears beneath the link caption) read_stream JSON string
source A URL to a Flash movie or video file to be embedded within the post read_stream JSON string containing the URL
icon A link to an icon representing the type of this post read_stream JSON string containing the URL
attribution [seems to be replaced with "application" property] A string indicating which application was used to create this post read_stream JSON string
actions A list of available actions on the post (including commenting, liking, and an optional app-specified action) read_stream A list of JSON objects containing the name and link
privacy The privacy settings of the Post Publicly accessible A JSON object containing the value field and optional friends, networks, allow and deny fields.

The value field may specify one of the following JSON strings: EVERYONE, CUSTOM, ALL_FRIENDS, NETWORKS_FRIENDS, FRIENDS_OF_FRIENDS.

The friends field must be specified if value is set to CUSTOM and contain one of the following JSON strings: EVERYONE, NETWORKS_FRIENDS (when the object can be seen by networks and friends), FRIENDS_OF_FRIENDS, ALL_FRIENDS, SOME_FRIENDS, SELF, or NO_FRIENDS (when the object can be seen by a network only).

The networks field may contain a comma-separated list of network IDs that can see the object, or 1 for all of a user's network.

The allow field must be specified when the friends value is set to SOME_FRIENDS and must specify a comma-separated list of user IDs and friend list IDs that 'can' see the post.

The deny field may be specified if the friends field is set to SOME_FRIENDS and must specify a comma-separated list of user IDs and friend list IDs that 'cannot' see the post.

Note: This privacy setting only applies to posts to the current or specified user's own Wall. Facebook ignores this setting for targeted Wall posts (when the user is writing on the Wall of a friend, Page, event, group connected to the user). Consistent with behavior on Facebook, all targeted posts are viewable by anyone who can see the target's Wall.

Privacy Policy: Any non-default privacy setting must be intentionally chosen by the user

created_time The time the post was initially published read_stream A JSON string containing a IETF RFC 3339 datetime
updated_time The time of the last comment on this post read_stream A JSON string containing a IETF RFC 3339 datetime
targeting Location and language restrictions for Page posts only manage_pages A JSON object containing comma separated lists of valid country, city, region, and locale
properties "property" values assigned when the post is published. This is typically rendered as a list of links. Publicly accessible A JSON encoded object containing possibly multiple key-value pairs where each key represents the name and the value (another JSON object) may contain any of the following: text, and href. When rendered, the text is the hypertext link to href and the aforementioned key of each object is the unlinked text that comes directly before it. (Ex. {"search engine:":{"text":"Google", "href":"http://www.google.com/"}}) only if properties were set on this post
type can have the following values: link, photo, status, swf, video (possibly also mp3)
application application which made the post JSON object containing name and id of application
object_id if the post is about a photo, note, video, etc then this is likely the id to that object JSON string
comments comments on this post JSON object which may contain count (a total count of comments) and may also have data which contains an array with a few comments (most likely the most recent ones) In some contexts count seems to be missing and a full list of comments are contained within the data (ex /me/photos has no count in the comments)

Connections

Name Description Permissions Returns
comments All of the comments on this post Available to everyone on Facebook An array of JSON objects containing id, from, message, and created_time fields
likes The likes on this post Available to everyone on Facebook An array of JSON objects containing the id and name fields

Publishing

Requires the publish_stream permission.

To publish a wall post, POST the message and optional attachment to the feed/wall of the user, page or group, i.e., http://graph.facebook.com/PROFILE_ID/feed. When publishing to a Page, to target a post to users in a specific location or language, use the appropriate values from the following files: all cities (CSV), major cities (CSV), locales (CSV), cities and locales (JSON).

curl -F 'access_token=...' \
     -F 'message=Check out this funny article' \
     -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' \
     -F 'actions={"name": "View on Zombo", "link": "http://www.zombo.com"}' \
     -F 'privacy={"value": "ALL_FRIENDS"}' \
     -F 'targeting= {"countries":"US","regions":"6,53","locales":"6"}' \
     https://graph.facebook.com/me/feed

The following arguments are supported:

message The message. read_stream. JSON string.
picture If available, a link to the picture included with this post. read_stream. JSON string containing the URL.
link The link attached to this post. read_stream. JSON string containing the URL
name The name of the link. read_stream. JSON string.
caption The caption of the link (appears beneath the link name). read_stream. JSON string.
description A description of the link (appears beneath the link caption). read_stream. JSON string.
source A URL to a Flash movie or video file to be embedded within the post. read_stream. JSON string containing the URL.
actions A list of available actions on the post (including commenting, liking, and an optional app-specified action). read_stream. A list of JSON objects containing the 'name' and 'link'.
privacy The privacy settings of the Post. Publicly accessible. A JSON object containing the value field and optional friends, networks, allow and deny fields.

The value field may specify one of the following JSON strings: EVERYONE, CUSTOM, ALL_FRIENDS, NETWORKS_FRIENDS, FRIENDS_OF_FRIENDS.

The friends field must be specified if value is set to CUSTOM and contain one of the following JSON strings: EVERYONE, NETWORKS_FRIENDS (when the object can be seen by networks and friends), FRIENDS_OF_FRIENDS, ALL_FRIENDS, SOME_FRIENDS, SELF, or NO_FRIENDS (when the object can be seen by a network only).

The networks field may contain a comma-separated list of network IDs that can see the object, or 1 for all of a user's network.

The allow field must be specified when the friends value is set to SOME_FRIENDS and must specify a comma-separated list of user IDs and friend list IDs that 'can' see the post.

The deny field may be specified if the friends field is set to SOME_FRIENDS and must specify a comma-separated list of user IDs and friend list IDs that 'cannot' see the post.

Note: This privacy setting only applies to posts to the current or specified user's own Wall. Facebook ignores this setting for targeted Wall posts (when the user is writing on the Wall of a friend, Page, event, group connected to the user). Consistent with behavior on Facebook, all targeted posts are viewable by anyone who can see the target's Wall.

Privacy Policy: Any non-default privacy setting must be intentionally chosen by the user. You may not set a custom privacy setting unless the user has proactively specified that they want this non-default setting.

targeting Location and language restrictions for Page posts only. manage_pages. A JSON object containing comma separated lists of valid country, city, region, and locale.

Notes/Bugs/Gotchas

Important note: Using the post method above, the application is limited to 25 posts per user per day and will return with the error "(341) Feed Action request limit reached" thereafter. A Dialog (via FB.ui) should be used instead, if you expect your application to create more than 25 posts on behalf of a given user in a day. Note that the 25 post limit was seemingly correct as of 2011-01-28. It was previously reported as both 10 and 15, so it seems likely that this may change over time.

Personal tools
Namespaces
Variants
Actions
Navigation
Graph API
FQL
Toolbox