Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam API v0001 gives a 404 #24

Closed
damoncasale opened this issue Aug 4, 2017 · 7 comments
Closed

Steam API v0001 gives a 404 #24

damoncasale opened this issue Aug 4, 2017 · 7 comments
Assignees

Comments

@damoncasale
Copy link

Attempting to call s.getSchema gives a 404. I traced the issue to the version in the requested path. Changing the version to v0002 works.

@Tidwell
Copy link
Owner

Tidwell commented Aug 4, 2017

Do you have some example code for this failing, I just tested locally and this seemed to work okay:

const Steam = require('steam-web');
const APIKEY = require('./key.js');

const s = new Steam({
  apiKey: APIKEY,
  format: 'json'
});

s.getSchema({
  gameid: 440,
  callback: (err, data) => {
    if (err) {
      throw new Error(err);
    }
    console.log(data);
  }
});

@Tidwell
Copy link
Owner

Tidwell commented Aug 4, 2017

It might be related to which gameid, perhaps different games are only supported on v2 - were you using tf2 (440) or another game?

@damoncasale
Copy link
Author

I was using CS:GO (730).

@Tidwell
Copy link
Owner

Tidwell commented Aug 4, 2017

Confirmed, 730 only works with v2 and 440 only works with v1. I'll have to see if the other IEconItems methods behave the same way. Probably have to do some kind of mapping, or default to requesting from v1 and if it fails make the request to v2.

@damoncasale
Copy link
Author

Might I suggest making the version number a parameter as well, with a default of v0001?

@Tidwell
Copy link
Owner

Tidwell commented Aug 4, 2017

Yea, that's probably the best stop-gap to get a fix out quickly, I hate the idea of making double requests or mapping, and without a breaking change that would necessitate a major version bump.

I'll update all the methods to accept an optional version config and to use their default (theres v0001, v0002, v1, and v2 so have to do it case-by-case).

This will at least allow implementors to use the methods if they find the default doesn't work.

@Tidwell Tidwell self-assigned this Aug 5, 2017
@Tidwell
Copy link
Owner

Tidwell commented Aug 5, 2017

0.6.0 has been published to NPM with support for the .apiVersion config property for all methods. This should resolve the issue.

@Tidwell Tidwell closed this as completed Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants