Hey guys!
I’m sitting here waiting for my reviews to come up and decided to start playing around with the API. I’ve only recently (a month ago) started learning how to connect to API’s and doing all the cool stuff that you can do with them. I’m currently trying to connect to my account using my API v2 key via the request node package.
When I try connecting, I keep getting a 401 error, and I figure it’s that I’m making a simple mistake when writing the header. The code is as follows:
let options = {
url: 'https://api.wanikani.com/v2/user',
headers: {'Authorization': '{API Key goes here}'}
}
request(options, function(error, response, body){
console.log(response.statusCode);
});
I’m certain I’m just not understanding the documentation on how I need to set this up.
Thanks in advance. <3