Skip to content

IG Comment Replies

Justin Stolpe edited this page May 21, 2022 · 2 revisions

Get and create replies for a comment.

Getting Replies

Get replies for a specified comment.

use Instagram\Comment\Replies;

$config = array( // instantiation config params
    'user_id' => '<IG_USER_ID>',
    'comment_id' => '<COMMENT_ID>', // id of comment to get replies on
    'access_token' => '<ACCESS_TOKEN>',
);

// instantiate replies for use
$replies = new Replies( $config );

// get replies on the comment
$commentReplies = $replies->getSelf();

Creating Replies

Create a reply to the specified comment.

use Instagram\Comment\Replies;

$config = array( // instantiation config params
    'user_id' => '<IG_USER_ID>',
    'comment_id' => '<COMMENT_ID>', // id of comment to get replies on
    'access_token' => '<ACCESS_TOKEN>',
);

// instantiate replies for use
$replies = new Replies( $config );

// create and post the reply
$reply = $replies->create( '<COMMENT>' );
Clone this wiki locally