Skip to content

The access_token provided is invalid #121

Description

@JimLynchCodes

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] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions