PHP-FUT-API icon indicating copy to clipboard operation
PHP-FUT-API copied to clipboard

List Item function

Open suckedjs opened this issue 7 years ago • 7 comments

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}

suckedjs avatar Apr 22 '17 08:04 suckedjs

Isn't this related to issue #41?

JKetelaar avatar Apr 22 '17 23:04 JKetelaar

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.

suckedjs avatar Apr 23 '17 08:04 suckedjs

anyone?

suckedjs avatar May 16 '17 09:05 suckedjs

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. ✅

JKetelaar avatar May 16 '17 21:05 JKetelaar

Great! Thanks for the response. Really looking forward to it!

suckedjs avatar May 17 '17 08:05 suckedjs

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 */

suckedjs avatar May 20 '17 07:05 suckedjs

Beast, great function. I'll start adding this into the API.

JKetelaar avatar May 20 '17 14:05 JKetelaar