-
Notifications
You must be signed in to change notification settings - Fork 31
IG Media
Justin Stolpe edited this page May 21, 2022
·
2 revisions
Represents an Instagram media post.
Get data on a specific users media post.
use Instagram\Media\Media;
$config = array( // instantiation config params
'user_id' => '<IG_USER_ID>,
'media_id' => '<MEDIA_ID>', // id of post to get data on
'access_token' => '<ACCESS_TOKEN>',
);
// instaniate media
$media = new Media( $config );
// get info on media post
$mediaInfo = $media->getSelf();
Enable or disable comments on a users media post.
use Instagram\Media\Media;
$config = array( // instantiation config params
'user_id' => '<IG_USER_ID>,
'media_id' => '<MEDIA_ID>', // id of post to enable or disable comments
'access_token' => '<ACCESS_TOKEN>',
);
// instaniate media
$media = new Media( $config );
// set comments enabled to true or false
$media->setCommentsEnabled( '<BOOLEAN>' );