Phiên bản API Đồ thị

Comment

Đọc

A Facebook comment

New Page Experience

This endpoint is supported for New Page Experience.

Feature Permissions

TênMô tả
Quyền truy cập nội dung công khai trên TrangThis feature permission may be required.

Ví dụ

Graph API Explorer
GET /v25.0/{comment-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{comment-id}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{comment-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{comment-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{comment-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Nếu bạn muốn tìm hiểu cách sử dụng API Đồ thị, hãy đọc Hướng dẫn sử dụng API Đồ thị của chúng tôi.

Thông số

Điểm cuối này không có bất kỳ thông số nào.

Trường

Trường thông tinMô tả
id
token with structure: Comment ID

The comment ID

admin_creator

For a comment made by a page, the page admin who wrote it. A page access token is required to access this field.

application

The app this comment was published by

attachment

Link or photo attached to the comment

can_comment
bool

Whether the viewer can reply to this comment

can_hide
bool

Whether the viewer can hide this comment from everyone except the comment author and the author's friends. This can only be true for comments on Page posts

can_like
bool

Whether the viewer can like this comment

can_remove
bool

Whether the viewer can remove this comment

can_reply_privately
bool

Whether the page viewer can send a private reply to this comment

comment_count
unsigned int32

Number of replies to this comment

created_time
datetime

The time this comment was made

from
User|Page

The profile that made this comment

is_hidden
bool

Whether this comment is hidden from everyone except the comment author and the author's friends

is_private
bool

Whether the comment is a private comment

like_count
unsigned int32

Number of times this comment was liked

live_broadcast_timestamp
unsigned int32

Time the comment was made on a live video

message
string

The comment text

message_tags

Profiles tagged in mentions in the message

object

The object the comment is on

parent

For comment replies, the comment this is a reply to

permalink_url
uri

The permanent static URL to the comment

private_reply_conversation

If private reply was sent to this comment, gets private conversation between the page and author of the comment that was started by private reply

user_likes
bool

Whether the viewer has liked this comment

Đường viền

CạnhMô tả
Edge<Comment>

Comments made on this

Edge<Profile>

People who like this

Edge<Profile>

People who reacted on this

Mã lỗi

LỗiMô tả
100Invalid parameter
80001There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
190Invalid OAuth 2.0 Access Token
283That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata
2500Error parsing graph query
459The session is invalid because the user has been checkpointed
613Calls to this api have exceeded the rate limit.
210User not visible

Tạo

Bạn có thể tạo yêu cầu POST đến cạnh comments từ các đường dẫn sau:
Khi đăng lên cạnh này, hệ thống sẽ tạo a Comment.

Thông số

Thông sốMô tả
attachment_id
numeric string or integer

ID for a photo attachment to associate with this

attachment_share_url
URL

Link to set the comment attachment to. Does not include the url in the message

attachment_url
URL

Link to set the comment attachment to

is_offline
boolean

Whether the comment was originally made while offline

message
UTF-8 string

Same as the text param

Hỗ trợ biểu tượng cảm xúc
text
UTF-8 string

The text of the comment that allows emoji

Hỗ trợ biểu tượng cảm xúc

Kiểu trả về

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: token with structure: Comment ID,
}

Mã lỗi

LỗiMô tả
100Invalid parameter
190Invalid OAuth 2.0 Access Token
368The action attempted has been deemed abusive or is otherwise disallowed
200Permissions error
1705There was an error during posting.
459The session is invalid because the user has been checkpointed

Cập nhật

Bạn có thể cập nhật a Comment bằng cách thực hiện yêu cầu POST đến /{comment_id}.

Thông số

Thông sốMô tả
attachment_id
numeric string or integer

ID for a photo attachment to associate with this

attachment_share_url
URL

Link to set the comment attachment to. Does not include the url in the message.

attachment_url
URL

Link to set the comment attachment to.

is_hidden
boolean

Is this comment hidden? Only applicable to Page comments

message
UTF-8 string

The text in the new comment message

Hỗ trợ biểu tượng cảm xúc

Kiểu trả về

Điểm cuối này hỗ trợ đọc sau khi ghi và sẽ đọc nút mà bạn đã đăng vào đó.
Struct {
success: bool,
}

Mã lỗi

LỗiMô tả
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
100Invalid parameter
80001There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
190Invalid OAuth 2.0 Access Token
210User not visible

Xóa

You can delete a Comment by making a DELETE request to /{comment_id}.

Thông số

Điểm cuối này không có bất kỳ thông số nào.

Kiểu trả về

Struct {
success: bool,
}

Mã lỗi

LỗiMô tả
200Permissions error
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed
190Invalid OAuth 2.0 Access Token