Graph API Version

Instagram Comment

Reading

An Instagram comment

Example

Graph API Explorer
GET /v3.3/{instagram-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(
    '/{instagram-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(
    "/{instagram-comment-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{instagram-comment-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{instagram-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.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription
id
string

Base 64 encoded string of instagram_media_id and instagram_comment_id

comment_type
enum

Enum indicating the type of comment {CAPTION, NORMAL, UNKNOWN}

created_at
datetime

Creation time of the comment in milliseconds

instagram_comment_id
numeric string

Id of the comment in instagram

instagram_user

Instagram user who made the comment

mentioned_instagram_users

Instagram users that are mentioned in the comment

message
string

Textual message content of the Instagram comment

Validation Rules

ErrorDescription
100Invalid parameter

Creating

You can make a POST request to comments edge from the following paths:
When posting to this edge, an InstagramComment will be created.

Parameters

ParameterDescription
ad_id
Numeric String

Ad id associated to this Instagram Media

Required
message
string

Comment text

RequiredSupports Emoji

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: string,
}

Validation Rules

ErrorDescription
100Invalid parameter
You can make a POST request to comments edge from the following paths:
When posting to this edge, an InstagramComment will be created.

Parameters

ParameterDescription
ad_id
Numeric String

Ad id associated to this Instagram Media

Required
message
string

Comment text

Required

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: string,
}

Validation Rules

ErrorDescription
100Invalid parameter

Updating

You can update an InstagramComment by making a POST request to /{instagram_comment_id}.

Parameters

ParameterDescription
ad_id
Numeric String

Ad Id associated to this Instagram Media

Required
hide
boolean

Boolean denoting whether the comment is to be hidden or unhidden

Required

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error

Deleting

You can delete an InstagramComment by making a DELETE request to /{instagram_comment_id}.

Parameters

ParameterDescription
ad_id
Numeric String

Ad Id associated to this Instagram Media

Required

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error