Recent media from a 2nd authorized Instagram user

Get the most recent media published by an authorized user. 

This example shows a 2nd Craft CMS user who has authorized Pic Puller for access with Instagram.

Notice that this is the user_id is the id from Craft, not from Instagram.


Documentation for this code example: Recent media

The code block below is generating the section that follows it.

{% for instagramdata in craft.picpuller.media_recent({'user_id' : 79,  'use_stale_cache' : true, 'limit': 4}) %}

  {% if loop.first %}
    <p>Status: {{ instagramdata.status }}</p>
    <p>Error Type: {{ instagramdata.error_type }}</p>
    <p>Error Message: {{ instagramdata.error_message }}</p>
    <hr>
  {% endif %}

  {% if instagramdata.status == 'true' %}
    <p>Loop Index: {{ loop.index }}</p>
    {% if instagramdata.video_low_resolution != '' %}
      <p>THERE IS VIDEO HERE!</p>
      <p>{{ instagramdata.video_low_resolution }}</p>
    {% endif %}
    <p><img src="{{instagramdata.low_resolution}}" alt='{{instagramdata.caption}}></p>
    <p>{{ instagramdata.media_id }}</p>
    <p>caption: {{instagramdata.caption}}</p>
    <p>created_time: {{ instagramdata.created_time }}</p>
  {% else %}
    <p>Error Type: {{ instagramdata.error_type }}</p>
    <p>Error Message: {{ instagramdata.error_message }}</p>
  {% endif %}


{% endfor %}

Status:

Error Type: OAuthAccessTokenException

Error Message: The access_token provided is invalid.


Error Type: OAuthAccessTokenException

Error Message: The access_token provided is invalid.