PHP-FUT-API
PHP-FUT-API copied to clipboard
List Item function
I am trying to list a player from my tradepile but with no success and I see there is no item listing function included. I suppose that's has something to do with sendRequestion().
This is the request the item listing function needs to make
POST /ut/game/fifa17/auctionhouse HTTP/1.1 Host: utas.external.s3.fut.ea.com User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Firefox/51.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Cookie: cookie DNT: 1 Connection: keep-alive Referer: https://www.easports.com/iframe/fut17/bundles/futweb/web/flash/FifaUltimateTeam.swf?cl=165353 Content-type: application/json Accept: application/json X-UT-PHISHING-TOKEN: token X-UT-SID: id X-UT-Embed-Error: true X-HTTP-Method-Override: POST Content-length: 84 {"startingBid":300,"duration":3600,"itemData":{"id":4444444444},"buyNowPrice":350}
Isn't this related to issue #41?
It could but is not. Do you have a method to list an item to the market?
On 23 Apr 2017, at 02:43, Jeroen Ketelaar [email protected] wrote:
Isn't this related to issue #41?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
anyone?
I'm really sorry for the delayed response. Unfortunately I cannot find time to achieve a result yet, hopefully I'll get it either this weekend or next weekend, it's on my top of my to-do list. ✅
Great! Thanks for the response. Really looking forward to it!
public function ListItem($tradeId, $startingBid, $buyNowPrice, $duration) {
if ($duration < 0) {
return -1;
}
return $this->sendRequest(URL::API_LIST_ITEM, Method::POST(),['startingBid' => $startingBid, 'duration' => $duration, 'itemData' =>[ 'id' => $tradeId] , 'buyNowPrice' => $buyNowPrice]);
}
There it is! It returns item Id if successful or code 500 if the arguments are wrong.
You can use it like this:
ListItem($tradeId, "350", "400", 3600));
/* 1 hour = 3600 */
Beast, great function. I'll start adding this into the API.