zzarcon / nodegram

:metal: Simplest Instagram Api library in Javascript
145 stars 6 forks source link

Error: cannot GET /v1/users/self/media/recent (400) #5

Open ilyanoskov opened 7 years ago

ilyanoskov commented 7 years ago

This is my code:

var Nodegram = require('nodegram');
var options = {
      clientId: ' 243ba3Y5a61864O4dYOLOb84d99e2dL1ccb7O0be0',
      clientSecret: '58df8PIMPb3e03d541P1a99dbI80fc5311Mf60Pb',
    redirectUri: 'http://localhost:8080'

};

var gram = new Nodegram(options);
var url = gram.getAuthUrl();

var code = '200';

gram.getAccessToken(code).then(function(res) {
      var token = res.access_token;

      console.log(res.user);

});

gram.get('/users/self/media/recent').then(onSuccess).catch(onError);

function onSuccess(res, pag) {
  console.log('onSuccess', res, pag);
}

function onError(err) {
  console.log('onError', err);
}

Which gives me an error OAuthParameterException "Missing client_id or access_token URL parameter.""

RafalWilinski commented 7 years ago

Pasting here your clientId and secret is not the best idea.

ilyanoskov commented 7 years ago

It's fake. clientId: ' 243ba3Y5a61864O4dYOLOb84d99e2dL1ccb7O0be0',