I am playing with Meteor, and I am trying to make an API call to my apispark account, having a look at the Meteor Documentation: http doc
1 - Meteor.http.get("http://www.google.com"));
works fine, returns me the google page.
2 - Meteor.http.get("https://myApi.apispark.net:443/v1/campaigns"));
Exception while invoking method 'getApiCampains' Error: failed [401] {"code":403,"description":"The server understood the request, but is refusing to fulfill it","reasonPhrase":"Forbidden"}
Which seems fine as I didnt provide any auth params.
3 - Meteor.http.get("https://myApi.apispark.net:443/v1/campaigns", {auth : '123:456'});
Exception while invoking method 'getApiCampains' Error: failed [401] {"code":401,"description":"The request requires user authentication", "reasonPhrase":"Unauthorized"}
Where 123
is my username and 456
is my private key.
So that is basically what is wrong for me, the two previous examples are here to show that my api calls are working in general, but not this one.
Can anyone see what I am doing wrong here? As I checked one billion time, my credentials are the same one as the one from my account on apispark.
As it is the first time I am playing with Meteor HTTP package and making an API call, I could have easily forgotten something there, maybe some options or something ?
Any help or tips would be really appreciated ! Thanks