Get and accept "trade offers "(Steam Web API)

Hello. I just started learning the Steam Web API, there is not much information.

Wanted to know how to use it to get incoming exchange offers and accept them?
Here is an article Steam Web API/IEconService, but it is difficult for me to understand it myself.

Author: Артём Ионаш, 2015-04-08

3 answers

This API does not provide the ability to accept an incoming exchange offer.

With it, you can only get a list of offers, cancel your own, or reject incoming ones. At the same time, it only works for the account that you have registered the API for naturally.

Example of a request to get a list of offers:

http://api.steampowered.com/IEconService/GetTradeOffers/v1/?key=********&get_sent_offers=1&time_historical_cutoff=100

You substitute the parameters you need, which are described in the manual, and the api key in the place of the asterisks

 2
Author: mJeevas, 2015-04-09 06:48:37
$url = 'https://steamcommunity.com/tradeoffer/' . $tradeID . '/accept';
$partnerID = '';
$tradeID = '';
 $data = array(
        'sessionid' => $sessionId,
        'serverid' => '1',
        'partner' => $partnerID,
        'tradeofferid' => tradeID,
        'captcha' => ''
    );
    $c = curl_init();
    curl_setopt($c, CURLOPT_HEADER, false);
    curl_setopt($c, CURLOPT_NOBODY, false);
    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)");
    curl_setopt($c, CURLOPT_COOKIE, $cookies);
    curl_setopt($c, CURLOPT_POST, 1);
    curl_setopt($c, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($c, CURLOPT_HTTPHEADER, array('Referer: https://steamcommunity.com/tradeoffer/' . $tradeID));
    curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($c, CURLOPT_CUSTOMREQUEST, strtoupper('POST'));
    $response = curl_exec($c);
    curl_close($c);
    echo $response;

$TradeID can be found by sending a Get request to http://api.steampowered.com/IEconService/GetTradeOffers/v1/?key=[API_KEY]&get_received_offers=1&time_historical_cutoff=100 ; We take $SessionID and $cookies from authorization.

 2
Author: Dmitry Shitov, 2016-10-27 20:51:50

This API allows you to get trade offers, as well as their IDs. So you can accept them with a simple Post request to https://steamcommunity.com/tradeoffer/"tradeId"/accept where tradeId is actually the offer ID.

In the header of the submission, you need to specify:

{"sessionid", ...},
{"serverid", ...},
{"tradeofferid", ...},
{"partner", ...},
{"captcha", ...}

The first two parameters must be stored in a container that is collected during authorization. The third and fourth parameters will be obtained via the API you suggested, and the captcha, by default, is string.empty

 0
Author: Wayer, 2016-03-30 21:11:13