Accept Trade Offer from Steam using Web-API & Java -
i have java steam trade bot reads through pending trade offers steam , declines them based on requirements. using official web api (using api key http://steamcommunity.com/dev/apikey) communicate requests steam. variable trade
own api interface (which have debugged , works declining offers).
steamplug.steamrequest(method, query);
basic http requester:
public static string steamrequest(string method, string query) { try { url obj = new url(query); httpurlconnection con = (httpurlconnection) obj.openconnection(); con.setrequestmethod(method); int responsecode = con.getresponsecode(); if (responsecode != 200 && responsecode != 201) { return "err" + responsecode; } bufferedreader in = new bufferedreader( new inputstreamreader(con.getinputstream())); string inputline; stringbuilder response = new stringbuilder(); while ((inputline = in.readline()) != null) { response.append(inputline); } in.close(); return response.tostring(); } catch (malformedurlexception | protocolexception e) { e.printstacktrace(); } catch (ioexception e) { // ignored } return null; }
this how declines trade offers:
steamplug.steamrequest( "post", "http://api.steampowered.com/ieconservice/declinetradeoffer/v0001/?key=" + steamplug.api_key + "&tradeofferid=" + trade.gettradeofferid() );
what trying accepting trades well. have tried this:
steamplug.steamrequest( "post", "https://steamcommunity.com/tradeoffer/" + trade.gettradeofferid() + "/accept?key=" + steamplug.api_key );
but receive 411 length required
response.
i believe can accept offers using steam session authentification, possible accept trade offer using user's web-api key?
have read steam api docs? there's no trade accept function, assume can't accept trades via api. option check steambot's (though written in c#) trade functions , think straight http requests steam site (with proper steam authentication believe). myself writing bot currently, , single thing stops me - accepting trades.
Comments
Post a Comment