I've been stuck on this forever now. I can't for the life figure out what I am doing wrong. I'm just trying to make a simple trade api query using BTER api. Here is my code. Bare with me, I'm fairly new to C#.
Ill give whoever shows me the way a small reward
If im doing something wrong or improper let me know please, so I can learn and fix it :x
string bterkey = "xxx";
string btersecret= "xxx";
string Url;
WebClient request = new WebClient();
DateTime dtCurTime = DateTime.Now;
DateTime dtEpochStartTime = Convert.ToDateTime("1/1/1970 8:00:00 AM");
TimeSpan ts = dtCurTime.Subtract(dtEpochStartTime);
long epochtime;
epochtime = ((((((ts.Days * 24) + ts.Hours) * 60) + ts.Minutes) * 60) + ts.Seconds);
Url = "
https://data.bter.com/api/1/private/orderlist?nonce=" + epochtime;
var dataStr = Url;
request.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
request.Headers.Add("key", bterkey);
var hmac = new HMACSHA512(Encoding.ASCII.GetBytes(btersecret));
var messagebyte = Encoding.ASCII.GetBytes(Url);
var hashmessage = hmac.ComputeHash(messagebyte);
var sign = BitConverter.ToString(hashmessage).Replace("-", "");
request.Headers.Add("sign", sign);
byte[] bret = request.UploadData(Url, "post", System.Text.Encoding.ASCII.GetBytes(""));
string sret = System.Text.Encoding.ASCII.GetString(bret);