Title: C#AND POLONIEX API CONNECT Post by: AMONRA75 on August 19, 2016, 04:00:03 PM hi,
i need an help to connect to poloniex api (non public) with c# anyone can help me ??? Code: const string WEBSERVICE_URL = "https://poloniex.com/tradingApi"; i see the error Code:
tnx a lot! Title: Re: C#AND POLONIEX API CONNECT Post by: Coding Enthusiast on August 19, 2016, 05:44:24 PM this header is extra
Code: webRequest.Headers.Add("command", "returnDepositAddresses"); i have WebRequest class :D you should put the "command" and "returnDepositAddresses" in httpcontent and sign that, then add the signature to the header "sign" i have no idea what you are doing here: Code: webRequest.Headers.Add("Sign", CreateSignature()); PHP is the closest example you can see and kind of understand when using c# IMO: http://pastebin.com/iuezwGRZ (see line 28 and 29) Title: Re: C#AND POLONIEX API CONNECT Post by: AMONRA75 on August 19, 2016, 10:39:06 PM i write the complete code
Code:
i have remove the extra headers but see the error Title: Re: C#AND POLONIEX API CONNECT Post by: Coding Enthusiast on August 21, 2016, 03:34:38 PM as i said i hate WebRequest it is too long :D
but here i made you a complete code for it using HttpClient only in 30 lines https://gist.github.com/Coding-Enthusiast/863f46ceef57ff2e1cf18adb8b34d926 Title: Re: C#AND POLONIEX API CONNECT Post by: starmman on February 17, 2017, 08:53:05 PM as i said i hate WebRequest it is too long :D but here i made you a complete code for it using HttpClient only in 30 lines https://gist.github.com/Coding-Enthusiast/863f46ceef57ff2e1cf18adb8b34d926 Thanks for sharing that link - you saved me a lot of time getting the signature generated, first API I tried since Cryptsy - seems line every API has its quirks. Title: Re: C#AND POLONIEX API CONNECT Post by: Coding Enthusiast on February 18, 2017, 05:18:58 AM Glad I could help ^^
Title: Re: C#AND POLONIEX API CONNECT Post by: Luser on June 04, 2017, 05:05:47 PM Coding Enthusiast,
I registered on this site only so I could say thank you for posting this! Dang, I would have been stuck for days on this, so thanks a big bunch to you! Now I can proceed in automatically losing my altcoins instead of having to throw them away manually! =) Best regards Luser PS. Thanks to Amonra75 too for asking, of course. The web is truly awesome at times! Title: Re: C#AND POLONIEX API CONNECT Post by: Coding Enthusiast on June 06, 2017, 03:40:31 AM I am glad that this code is still helping people :)
Title: Re: C#AND POLONIEX API CONNECT Post by: matscol on July 21, 2017, 11:26:54 PM I'll add my thanks. This helped set up CB/GDAX api access as well.
Title: Re: C#AND POLONIEX API CONNECT Post by: SomeOneMore on January 05, 2018, 05:41:50 PM can you please put the code for call the command "returnOpenOrders"?
"Returns your open orders for a given market, specified by the "currencyPair" POST parameter, e.g. "BTC_XCP". Set "currencyPair" to "all" to return open orders for all markets. Sample output for single market:" Thanks in advance Title: Re: C#AND POLONIEX API CONNECT Post by: Coding Enthusiast on January 06, 2018, 05:59:21 PM Just change line #6 command from "returnBalances" to "returnOpenOrders" and add an optional parameter after it and before nonce, "¤cyPair=BTC_XCP".
It should work. I don't have a poloniex account anymore to test it. Title: Re: C#AND POLONIEX API CONNECT Post by: SomeOneMore on January 06, 2018, 09:30:13 PM Just change line #6 command from "returnBalances" to "returnOpenOrders" and add an optional parameter after it and before nonce, "¤cyPair=BTC_XCP". It should work. I don't have a poloniex account anymore to test it. it works. thanks |