How to get token??
Nits7029 opened this issue · 2 comments
Nits7029 commented
Hello,
how to and where I can get token??
And also how to insert more data into user collection once user logged in successfully?
Thanks.
Nomeasmo commented
// On server
Meteor.methods({
getInfo: function () {
let accessToken = Meteor.users.findOne({_id: Meteor.userId()}).services.instagram.accessToken;
return "baz " + this.userId + " " + JSON.stringify(HTTP.call('GET', "https://api.instagram.com/v1/users/self?access_token=" + accessToken, null ), null, 2);
}
});
This code requires meteor add http
If you are logged in. (e.g. use the code from this repository found in examples directory)
You can call the above method from the browser console
Meteor.call('getInfo', function(e, r) {console.log(r)})
Maybe it might be better exposed e.g. Instagram.accessToken()
sangyoo91 commented
I'm trying to figure this out too. When I try to use endpoints from currentUser.servcies.instagram.accessToken
, it will say that my accessToken is not valid.