ickerio / fortnite.js

A powerful and super light Fortnite stats API wrapper for Node.js.
ISC License
4 stars 1 forks source link

403 error #1

Closed danielgolden closed 6 years ago

danielgolden commented 6 years ago

Thanks a ton for creating this. I'm having issues standing it up. I've followed the steps in your readme, but I'm getting HTTP Error: 403 Forbidden every time I run my app. I've included my api key as well and I'm just not sure what the issue could be.

ickerio commented 6 years ago

Hi! I’m currently away right now so I can’t fully check on your issue. Could you just provide the full JSON output of the error? Thanks

Andrew814 commented 6 years ago

Im also getting the same error

EXtremeExploit commented 6 years ago

getting same error here

Andrew814 commented 6 years ago

I wonder if the API is not working

Andrew814 commented 6 years ago

It's really annoying though

ickerio commented 6 years ago

I'm now able to fix this issue, are you still getting the 403 error?

EXtremeExploit commented 6 years ago

yes

danielgolden commented 6 years ago

Yes, I am as well. I also don't remember getting any output from this error beyond what I included in the initial issue comment. Just a generic "403" error.

ickerio commented 6 years ago

I'm having trouble replicating this issue. Sorry about this. So is this happening every request or just some? Could you console.log the catch and post it here please. Cheers

EXtremeExploit commented 6 years ago

the only thing I get it's "HTTP Error: 403 Forbidden" in a catch

danielgolden commented 6 years ago

To be honest with you, @ickerio I'm brand new to node and the use of apis via js and this issue probably has a lot to do with that. I set up a node project, installed your package, pasted in the sample js into my app.js file:

// Bring in the Fortnite module
const { Client } = require('fortnite');
// Create an instance of the client with your API Key
const fortnite = new Client('Your-API-Key');

// Get the stats of an Xbox player by the name of Number1Swifty
fortnite.user('freshasalwayz', 'psn').then(console.log);

Then I swapped out your username, platform, and api key for mine (though I didn't include my api key above). Saved, ran node app.js and then got the 403 error logged to the console. "HTTP Error: 403 Forbidden".

ickerio commented 6 years ago

That code is for the module fortnite not fortnite.js so thats probably your issue. Ask here if your using his wrapper. https://www.npmjs.com/package/fortnite 😆

I was also just about to say the only case I get a 403 error is if my api key is wrong, so theres likely something wrong with his wrapper.

danielgolden commented 6 years ago

Ahh, my bad. I just copied it from the other module's site to try to show you what I did but I meant copy it from yours. When I get this error is actually from your modules sample code. I just can't go find it right now because I have to work/am lazy 😓 . I'll try to go track it down and send it your way when I get a break.

ickerio commented 6 years ago

Closing. If you are still experiencing this issue and find a way to consistently reproduce the error keep it open then.