codingbadger / instant-tokens.com

11 stars 0 forks source link

Uncaught Error: Error from Instagram: The access_token provided is invalid. #9

Closed hessbeck closed 3 years ago

hessbeck commented 3 years ago

Hi,

I receive the above mentioned error code on my website. I am using the follow code:

<script src="https://ig.instant-tokens.com/users/eb555dc9-04e1-4161-947a-81dfd4247f72/instagram/17841403165256016/token.js?userSecret=n7adud9oixntiie9tf1g7n"></script>
<div id="instafeed">
</div>

<script type="text/javascript">
//<![CDATA[
    var feed = new Instafeed({
      accessToken: InstagramToken
    });
    feed.run();
//]]>
</script>

Also I am using Instafeed.js version v2.0.0-rc2. Using the code on Codepen it totally works fine and my feed does appear.

Error code/message on website is:

Uncaught Error: Error from Instagram: The access_token provided is invalid.
    parse https://u.jimcdn.com/e/o/s2f58a1ad850b505e/userlayout/js/instafeed-min.js?t=1484401789:2
    <anonymous> https://api.instagram.com/v1/media/popular?access_token=IGQVJWTFNiUUFabjNIblFNM080MkpkRjZAiNjU2NlRENGVZAbDJReHZArc0d0S0s1eVRqMmF5ZAnpRajhBakNIaW5wS0xPOXpMREFHUFZA1QlZAWTVNxUFA0V2hmeXlmNndnaGZA6ak9OUlFB&callback=instafeedCache72cca702f75eb34b.parse:1
instafeed-min.js:2:1640
    parse https://u.jimcdn.com/e/o/s2f58a1ad850b505e/userlayout/js/instafeed-min.js?t=1484401789:2
    <anonym> https://api.instagram.com/v1/media/popular?access_token=IGQVJWTFNiUUFabjNIblFNM080MkpkRjZAiNjU2NlRENGVZAbDJReHZArc0d0S0s1eVRqMmF5ZAnpRajhBakNIaW5wS0xPOXpMREFHUFZA1QlZAWTVNxUFA0V2hmeXlmNndnaGZA6ak9OUlFB&callback=instafeedCache72cca702f75eb34b.parse:1

Any ideas what I am doing wrong? Any hints are appreciated!

codingbadger commented 3 years ago

Hi @hessbeck

Sorry for the delay, I think you are using the wrong version of Instafeed.js as the v2 of Instafeed does not reference the access token as access_token

Can you check you are definitely using v2

hessbeck commented 3 years ago

Hi @codingbadger

thanks for your reply! I am using the Instafeed.js from that site: https://github.com/stevenschobert/instafeed.js/releases/tag/v2.0.0-rc2

I've added the instafeed.min.js to my head on my website.

Is that the wrong version?

codingbadger commented 3 years ago

Can you post your code or provide a link to the page? The error message would indicate you are using the old Instagram API

hessbeck commented 3 years ago

@codingbadger I found a wrong reference in my code! So now its working as expected! Thank you!