I was not able to get a response with just a client ID, an access token was required. I found a fairly painless way to get my client ID (remember we need the numeric client ID) and an access token from the tutorial here:
https://blueprintinteractive.com/blog/how-instagram-api-fancybox-simplified
It had an automated generator for both.
You can then modify the snippet InstaRecentMedia to:
<?php
$json = file_get_contents('https://api.instagram.com/v1/users/'. $user_id .'/media/recent/?access_token=' . $access_token . '&count=' . $count);
$decode = json_decode($json, true);
$output = '';
foreach ($decode['data'] as $post) {
$output .= $modx->getChunk($tpl,
array(
'link' => $post['link'],
'image' => $post['images']['standard_resolution']['url'],
'thumbnail' => $post['images']['thumbnail']['url'],
'comments' => $post['comments']['count'],
'likes' => $post['likes']['count'],
'caption' => $post['caption']['text']
)
);
}
return $output;
And in your document use:
[[!InstaRecentMedia?
&user_id=`_NUMERIC USER ID_`
&access_token=`_YOUR ACCESS TOKEN_`
&count=`_HOW MANY ARTICLE WE WANT TO GET_`
&tpl=`tpl.InstaRecentMedia`
]]