Skip to content

Instantly share code, notes, and snippets.

@cosenary
Last active June 14, 2019 19:49
Show Gist options
  • Save cosenary/3287237 to your computer and use it in GitHub Desktop.
Save cosenary/3287237 to your computer and use it in GitHub Desktop.
Instagram PHP API - Likes
<?php
require 'Instagram.php';
use MetzWeb\Instagram\Instagram;
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK'
));
$token = 'USER_ACCESS_TOKEN';
$instagram->setAccessToken($token);
$id = 'MEDIA_ID';
$result = $instagram->likeMedia($id);
if ($result->meta->code === 200) {
echo 'Success! The image was added to your likes.';
} else {
echo 'Something went wrong :(';
}
@sanjeetbisht
Copy link

[id] => 975440137915646571_243281967

this is your id @umutc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment