Originally Posted by
cr0c
Actually there is. The GW2 API is refreshed every minutes. In game, it is refreshed on request.
Didnt know about it, thx for the info ![Smile](https://www.ownedcore.com/forums/images/smilies/smile.png)
Originally Posted by
cr0c
What do you mean by "an order on a certain data_id"?
I mean placer an order on a certain item.
Before, it was possible to do it like that :
To place an order on an item, you need :
- Data Id (mithril ore = 19700)
- Unit Price (price to put the order)
- Quantity (the quantity you want to order)
Your cookie (session ID linked to your gw2account)
And i'm looking atm for the code to place an order, right now i have no clue how to get this ^^'
For exemple, this was my c# code for order item (on the old TP)
Code:
static void OrderItem(string ItemId, int Quantity, string Price)
{
using (WebClient client = new WebClient())
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://tradingpost-fra-live.ncplatform.net/ws/item/" + ItemId + "/buy");
request.Accept = "*/*";
request.Headers.Add("Accept-Charset", "iso-8859-1,*,utf-8");
request.Headers.Add("Accept-Encoding", "gzip;q=0");
request.Headers.Add("Accept-Language", "en");
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.19 Awesomium/1.7.1";
request.Headers.Add("Cookie", "s=" + sCookie);
string postData = "count=" + Quantity + "&price=" + Price + "&charid="; //+ "";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] byte1 = encoding.GetBytes(postData);
request.ContentLength = byte1.Length;
request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
request.Headers.Add("Origin", "https://tradingpost-fra-live.ncplatform.net");
request.Referer = "https://tradingpost-fra-live.ncplatform.net/item/" + ItemId;
request.Headers.Add("X-Requested-With", "XMLHttpRequest");
request.KeepAlive = true;
request.Host = "tradingpost-fra-live.ncplatform.net";
request.Method = "POST";
Stream newStream = request.GetRequestStream();
newStream.Write(byte1, 0, byte1.Length);
newStream.Close();
WebResponse response = request.GetResponse();
Stream dataStream2 = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream2);
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream2.Close();
response.Close();
}
catch (Exception e)
{
Console.WriteLine("OrderItem " + e);
}
}