IG User Mentions - jstolpe/instagram-graph-api-php-sdk GitHub Wiki

Allows you to comment on posts and comments the user is tagged in.

Replying to a Post

Reply to a post the user was mentioned in.

use Instagram\User\Mentions;

$config = array( // instantiation config params
    'user_id' => '<IG_USER_ID>',
    'access_token' => '<ACCESS_TOKEN>',
);

// instantiate mentions for use
$mentions = new Mentions( $config );

$mentionsParams = array( // reply to a post the user was mentioned in
    'media_id' => '<MEDIA_ID>', // media id the user was mentioned in
    'message' => '<COMMENT>', // comment text
);

// post the comment
$mentions->replyToMedia( $mentionsParams );

Replying to a Comment

Reply to a comment the user was mentioned in.

use Instagram\User\Mentions;

$config = array( // instantiation config params
    'user_id' => '<IG_USER_ID>',
    'access_token' => '<ACCESS_TOKEN>',
);

// instantiate mentions for use
$mentions = new Mentions( $config );

$mentionsParams = array( // reply to a comment the user was mentioned in
    'comment_id' => '<COMMENT_ID>', // comment id the user was mentioned in
    'message' => '<COMMENT>', // comment text
);

// post the comment
$mentions->replyToComment( $mentionsParams );
⚠️ **GitHub.com Fallback** ⚠️