mckelvey / instagram-node-lib

The Instagram Node Lib is a helper library for node that makes communicating with the Instagram API easy.
http://david.mckelveycreative.com/
Other
302 stars 49 forks source link

Missing client_id or access_token URL parameter #44

Open eldyvoon opened 8 years ago

eldyvoon commented 8 years ago

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) } });

});

richardpenner commented 8 years ago

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.

michaeleekk commented 7 years ago

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.