CData Python Connector for Facebook

Build 23.0.8839

Posts

Create, delete, and query the Posts for a Target based on either the Target or Id. Posts can also be inserted based on a Target, or deleted based on Id. This table requires authentication.

Table Specific Information

Posts in Facebook are posts to a user's profile feed. Posts can be made to a user, page, application, group, or event.

Note: Due to a deprecation in the Facebook API, queries to the Comments, Photos, Posts, and Videos views where a user profile is either the defined or default target, no longer return data for the following fields:

  • comments
  • message_tags
  • reactions
  • sharedposts
  • story
  • story_tags
  • to
  • via
For further information, see https://developers.facebook.com/docs/graph-api/changelog/version16.0.

Select

When selecting posts, a target may be specified. The target represents a page or another valid entity that may have posts for it. If no target is specified, the authenticated user will be used as the target. For example, to retrieve posts made by a page:

SELECT * FROM Posts WHERE Target = 'PageId'

If you know the post Id, you can specify the Id to obtain information about the specific post. For example:

SELECT * FROM Posts WHERE Id = 'PostId'

When querying posts, elements may be retrieved by specifying either the CreatedTime or the UpdatedTime. For example:

SELECT * FROM Posts WHERE Target = 'facebook' AND CreatedTime >= '1/1/2012' AND CreatedTime <= '2/1/2012'

Insert

To insert a post, you will need to specify the Target and Message of the post. For instance:

INSERT INTO Posts (Message, Target) VALUES ('My New Post', 'PageId')

Create a photo post by using the Link or ObjectId columns. With the Link column, specify the accessible URL of an image to add the post to. You can also create video posts:

INSERT INTO Posts (Message, Target, Link) VALUES ('My New Post', 'PageId', 'http://imagerepo.net/testimage.png)'

INSERT INTO Posts (Message, Target, Link) VALUES ('My New Post', 'PageId', 'http://samplevideos.net/newmovie.mp4)'

You can also set local files in the Link column to upload media. Note that you must set UploadLinkedMedia to true for this to work:

INSERT INTO Posts (Message, Target, Link) VALUES ('From Local', 'PageId', 'file://D://test/sample.mp4')

With the ObjectId column, specify the ID of an unpublished photo in your account. To upload a photo without publishing it, use the UploadPhoto stored procedure. Video Ids are not supported:

INSERT INTO Posts (Message, Target, ObjectId) VALUES ('My New Post', 'PageId', '43572')

Update

Facebook does not allow posts to be updated.

Delete

Posts can be deleted by issuing a DELETE statement and specifying the Id of the post. Please note that Facebook allows only posts created by your app to be deleted using your app.

Columns

Name Type ReadOnly Description
ID [KEY] String True

The Id of the post.

Target String False

The Id or username of the target you are retrieving posts for or are posting to. This can be an event, group, page, or user.

FromId String True

Id of the user who made the post.

FromName String True

Name of the user who made the post.

FromPicture String True

Picture of the user who made the post.

FromCategory String True

Category of the user who made the post. FromCategory can only be retrieved if the other From* fields are not selected.

ToData String True

An aggregate of users the post was made to.

Message String False

The message of the post. A message is required when inserting a post.

MessageTags String True

An aggregate of objects tagged in the message such as users, pages, etc.

Attachments String True

An aggregate for the attachments of the post.

Picture String False

A link to the picture included in the post.

FullPicture String False

A link to the original picture included in the post. The one listed in Picture may be a resized smaller version.

Icon String True

Link to an icon representing the type of post.

Actions String True

An aggregate of available actions on the post such as commenting or liking.

CommentsCount Integer True

The number of comments for the post.

LikesCount Integer True

The number of times the post has been liked.

SharesCount Integer True

The number of times the post has been shared.

PlaceId String False

The Id of the location associated with the post, if any.

PlaceName String True

The name of the location associated with the post, if any.

ApplicationId String True

Id of the application this post came from.

ApplicationName String True

Name of the application this post came from.

ApplicationCanvasName String True

Information about the application used to create the entity.

ApplicationNamespace String True

Information about the application used to create the entity.

Story String True

Text of stories not intentionally generated by users, such as those generated when two users become friends; you must have the Include Recent Activity Stories migration enabled in your app to retrieve these stories. Requires the read_stream permission.

StoryTags String True

An aggregate of objects (users, pages, etc.) associated with the story.

LikesData String True

An aggregate of like data.

CommentsData String True

An aggregate of comments for this post.

CreatedTime Datetime True

When the post was created.

UpdatedTime Datetime True

When the post was last updated.

Pseudo-Columns

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.

Name Type Description
TaggedUser String

If set to an Id or username, it will retrieve posts where the specified user has been tagged. Requires the read_stream permission.

LocationUser String

If set to an Id or username, it will retrieve location posts where the user has been tagged. Requires the user_photos and user_status permissions.

Link String

A link to attach to the post. For use with the creation of posts. For post creation, either Link or Message columns are required.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839