instagram-node-lib icon indicating copy to clipboard operation
instagram-node-lib copied to clipboard

Missing client_id or access_token URL parameter

Open eldyvoon opened this issue 8 years ago • 2 comments

I got this error executing below code :

OAuthParameterException occurred: Missing client_id or access_token URL parameter. in _request

var instagram_client_id = '43345435345'; var instagram_client_secret = '4354565564'; var instagram_access_token = '3454656.3443532f0e6524'

instagram.set('client_id', instagram_client_id); instagram.set('client_secret', instagram_client_secret); instagram.set("access_token", instagram_access_token);

app.post('/subscribe', function(req, res){ instagram.tags.recent({ name: current_tag, count: 1, complete: function(data){ console.log(data) } });

});

eldyvoon avatar Aug 19 '16 07:08 eldyvoon

I've seen a similar error: Missing access_token URL parameter.. It was fixed by adding one line to_request_ in class.instagram.js:

options['headers']['Content-Length'] = post_data.length;
options['headers']['Content-Type'] = 'application/x-www-form-urlencoded'; // this is the new line

I think this project might be abandoned, but if not I'm happy to do a PR.

richardpenner avatar Sep 02 '16 20:09 richardpenner

Looks like with

Instagram.set('access_token', IG_TOKEN)

instead of client_id and client_secret, you can set the access token. But you need to get your access token by some other ways.

michaeleekk avatar Jun 26 '17 08:06 michaeleekk