I am trying to make a website that displays my friend's instagram follower count and recent images. I finally think I have figured out how to do it but I am running into an error. Every time I run my php file I get
stdClass Object ( [meta] => stdClass Object ( [error_type] => APINotFoundError [code] => 400 [error_message] => invalid media id ) )
The code I am running is:
<?php
function extractData(){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"https://api.instagram.com/v1/media/shortcode/D?access_token=*");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$activate= extractData();
print_r(json_decode($activate));
?>
I have a valid access key I just took it out for security reasons.