HTTPPHP SDKJavaScript SDKAndroid SDKiOS SDK Graph API Explorer
GET /v21.0/{comment-id} HTTP/1.1Host: 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\}];
If you want to learn how to use the Graph API, read our Using Graph API guide.
For a comment made by a page, the page admin who wrote it. A page access token is required to access this field.
application<br>Application
The app this comment was published by
attachment<br>StoryAttachment
Link or photo attached to the comment
can_comment<br>bool
Whether the viewer can reply to this comment
can_hide<br>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<br>bool
Whether the viewer can like this comment
can_remove<br>bool
Whether the viewer can remove this comment
can_reply_privately<br>bool
Whether the page viewer can send a private reply to this comment
comment_count<br>unsigned int32
Number of replies to this comment
created_time<br>datetime
The time this comment was made<br>Default
from<br>User|Page
The profile that made this comment<br>Default
is_hidden<br>bool
Whether this comment is hidden from everyone except the comment author and the author's friends
is_private<br>bool
Whether the comment is a private comment
like_count<br>unsigned int32
Number of times this comment was liked
live_broadcast_timestamp<br>unsigned int32
Time the comment was made on a live video
message<br>string
The comment text<br>Default
message_tags<br>list<EntityAtTextRange>
Profiles tagged in mentions in the message
object
The object the comment is on
parent<br>Comment
For comment replies, the comment this is a reply to
permalink_url<br>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
Comment
Reading
A Facebook comment
New Page Experience
This endpoint is supported for New Page Experience.
Feature Permissions
Example
HTTPPHP SDKJavaScript SDKAndroid SDKiOS SDK Graph API Explorer
If you want to learn how to use the Graph API, read our Using Graph API guide.
Parameters
This endpoint doesn't have any parameters.
Fields
id<br>token with structure: Comment IDadmin_creator<br>Userapplication<br>Applicationattachment<br>StoryAttachmentcan_comment<br>boolcan_hide<br>boolcan_like<br>boolcan_remove<br>boolcan_reply_privately<br>boolcomment_count<br>unsigned int32created_time<br>datetimefrom<br>User|Pageis_hidden<br>boolis_private<br>boollike_count<br>unsigned int32live_broadcast_timestamp<br>unsigned int32message<br>stringmessage_tags<br>list<EntityAtTextRange>objectparent<br>Commentpermalink_url<br>uriprivate_reply_conversationuser_likes<br>boolEdges
comments<br>Edge<Comment>likes<br>Edge<Profile>reactions<br>Edge<Profile>Error Codes
Creating
You can make a POST request to
commentsedge from the following paths:/{video_id}/commentsWhen posting to this edge, a Comment will be created.
Parameters
attachment_id<br>numeric string or integerattachment_share_url<br>URLattachment_url<br>URLis_offline<br>booleanmessage<br>UTF-8 stringtext<br>UTF-8 stringReturn Type
This endpoint supports read-after-write and will read the node represented by
idin the return type.Struct {
id: token with structure: Comment ID,}
Error Codes
Updating
You can update a Comment by making a POST request to
/{comment_id}.Parameters
attachment_id<br>numeric string or integerattachment_share_url<br>URLattachment_url<br>URLis_hidden<br>booleanmessage<br>UTF-8 stringReturn Type
This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,}
Error Codes
Deleting
You can delete a Comment by making a DELETE request to
/{comment_id}.Parameters
This endpoint doesn't have any parameters.
Return Type
Struct {
success: bool,}
Error Codes