Jump to content
McKay Development

SteamTradeofferManager: Cannot obtain a session (access denied)


GoKritz

Recommended Posts

Failed to obtain API key.
Error: Access Denied
    at SteamCommunity.<anonymous> (/storage/tradingbot/node_modules/steamcommunity/components/webapi.js:15:20)
    at Request._callback (/storage/tradingbot/node_modules/steamcommunity/components/http.js:67:15)
    at Request.self.callback (/storage/tradingbot/node_modules/request/request.js:185:22)
    at Request.emit (node:events:390:28)
    at Request.<anonymous> (/storage/tradingbot/node_modules/request/request.js:1154:10)
    at Request.emit (node:events:390:28)
    at Gunzip.<anonymous> (/storage/tradingbot/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:509:28)
    at Gunzip.emit (node:events:390:28)
    at endReadableNT (node:internal/streams/readable:1343:12)

SOURCE CODE: https://github.com/porkandbeans/tradingbot/blob/26ba3290cc0103cb37a17ba2c5b3bd5745fe25f8/bot.js#L109

I'm assuming SteamCommunity isn't supposed to be trying to get this data anonymously. What am I doing wrong here?

Link to comment
Share on other sites

Update - I've discovered this error was because I did not have a Steam developer API key for my bot account. These are available when you have games on your steam account valued at or above $5 USD. After remedying, this error no longer appears.

However...

The newOffer event is still not firing for me and I am not sure why... how long do I typically have to wait after making purchases for this to work?

Link to comment
Share on other sites

newOffer shouldn't take longer than 30 seconds. It should be pretty much instant if you passed a SteamUser instance to TradeOfferManager.

You might try outputting TradeOfferManager's debug output to see if anything is amiss:

_manager.on('debug', (msg) => {
    console.log(`[TradeOfferManager Debug] ${msg}`);
});

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...