jonbo / node-steam-webapi

Steam WebAPI wrapper for node.js
MIT License
48 stars 20 forks source link

getPublishedFileDetails array arguments incorrect #14

Open Cyken-Zeraux opened 7 years ago

Cyken-Zeraux commented 7 years ago

Problem:

The 'getPublishedFileDetails' method requires the key 'publishedfileids[0]' with the [0] included.

Code

const Steam  = require('steam-webapi');
Steam.key = apikey;
Steam.ready(function(err) {
    if (err) throw (err);

    var steam = new Steam();

    steam.getPublishedFileDetails({"itemcount": "1", "publishedfileids[0]": "835533549"}, function(err, data) {
        if (err) throw (err);
        console.log(data);
    });
}

Result:

"Missing required field: publishedfileids"

Code 2:

//Changed object key
{"itemcount": "1", "publishedfileids": "835533549"}

Result 2:

"HTTP 400 Bad Request"

Cause:

paramName = paramName.replace("[0]","");

Commenting out this line located in 'getParams' in the index.js file will make the request work as intended, returning the full request body properly. I have not made a PR because I do not know if removing that line will break other methods or not.