Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The access_token provided is invalid #121

Open
JimLynchCodes opened this issue Nov 24, 2017 · 0 comments
Open

The access_token provided is invalid #121

JimLynchCodes opened this issue Nov 24, 2017 · 0 comments

Comments

@JimLynchCodes
Copy link

Hi, I'm not sure why I am getting errors every time here. recreate my secret, follow the guide here: (https://www.slickremix.com/docs/how-to-create-instagram-access-token/) to get a access_token, and then call like this:


function searchInstagram() {


    var ig = require('instagram-node').instagram();


    ig.use({ access_token: 'XXXXXX.XXXXXXXXXXXXXXXX' });
    ig.use({ client_id: 'XXXXXXXXXXXXXXXXXXXXXXXXX',
        client_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXX' });

    /* OPTIONS: { [min_tag_id], [max_tag_id] }; */
    ig.tag_media_recent('tag', [], function(err, medias, pagination, remaining, limit) {
        console.log('err', err);
        console.log('medias', medias);
        console.log('pagination', pagination);
        console.log('remaining', remaining);
        console.log('limit', limit);
    });
}

searchInstagram();

But sadly when I call with node insta-service.js I always am getting this error:

node instagram-service.js 
derp
err { Error: OAuthAccessTokenException: The access_token provided is invalid.
    at handle_error (/Users/jameslynch/Git-Projects/Instagram-Serverless-Bot/node_modules/instagram-node/lib/instagram.js:242:19)
    at /Users/jameslynch/Git-Projects/Instagram-Serverless-Bot/node_modules/instagram-node/lib/instagram.js:1195:16
    at IncomingMessage.<anonymous> (/Users/jameslynch/Git-Projects/Instagram-Serverless-Bot/node_modules/instagram-node/lib/instagram.js:197:18)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  code: 400,
  error_type: 'OAuthAccessTokenException',
  error_message: 'The access_token provided is invalid.',
  retry: [Function: retry] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant