New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BTCChina always returns 401 #191
Comments
It could be that either the service is temporarily down or BTC-China changed their API unannounced. They had really bad docs to begin with and in fact I've never personally seen any docs. I'll log into their site and see if I can find anything. |
Thanks. I saw this url on your attachment: http://btcchina.org/api-trade-documentation-en |
I'm getting a Given that and my lack of free time ATM, I don't have time to look into your issue. I apologize for that. I'd be happy to accept a PR and answer any questions if you have them. |
Has anyone been able to verify / solve this problem? I seem to be having the same issue. I'm developing for iOS and have verified that my auth is correct (by checking hash / tonce / poststring etc with demo code which works) but still i keep getting "401 Unauthorized" errors. Please help :) |
I did have some problems accessing BTCChina a few weeks back; after I changed the url to https://vip.btcchina.com, it was OK:
BTW @timmolter , I think the current way to override default exchange settings could be improved to make it less error-prone and more user-friendly. I don't have time to do anything about it right now though. |
Thanks for your reply mmazi! Unfortunately it did not help me since i'm still getting 401s. I know this has nothing to do with XChange since this is iOS code, but i've been stuck on this for two weeks and getting frustrated. That being said XChange is an awesome library, i often check to see the newest APIs :) Hopefully someone can spot an error in my approach below: (i have checked the tonce, access key and Basic Auth header with demo code that works, they are OK)
|
I recently added the vip subdomain, and pushed the change. Regarding the 401 error, I cannot give any feedback on that as I haven't tried to use any of the authenticated API calls to BTC-China. I have been successful at using the market data API calls though. Of course, there is no authorization required for that, so it's a different ball game. All I can recommend is that you either contact BTCChina for help or try to contact the original author who wrote our BTC-China code, and see if he knows how to get it to work. @mmazi When you have some time, let me know what your idea is, and I'll implement it. Thanks as always! |
I was able to work around this by using the python example given in the API docs. The server seems to accept this format: *Let me clarify my results: I get the error message for no apparent when calling sellOrder and buyOrder using the PHP example but both work correctly when using the Python example. |
For what its worth; the BTCCPollingAccountService.getAccountInfo() calls; On Tue, Nov 12, 2013 at 7:37 AM, devinbethel notifications@github.comwrote:
|
Is the python example provided by official works? I doubt. It takes me long time to test, and I make all the efforts to make |
Hi all, 'params' => array("price" => $params[0],"amount" => $params[1],), Im not sure if this is the right way of assigning the values for 'params'. Is there any other place I should have changed? . Thank you for any suggestion. Cheers |
Did you try adding params to signature function?. The example code in PHP has comment the $params var. |
The problem is that http_build_query substitutes the comma which delimits the items in the method parameter.. Check https://gist.github.com/mkraemer/7483878#file-btcchina-api for a working example :) |
@3lm4dn0 @mkraemer Thank you for your kind reply and the example. I really would like to have my code work if possible (it's easier for me to understand and modify). So now I changed the code as following and left the rest the same as the demo.
in try()
But it still does not work :(. Any suggestion? Thank you so much. Cheers. |
@mkraemer Update. I replaced the http_build_query with your sprintf function and it works now! :D Regards |
@foolooo I have same problem with you. can you give me full code. thank you very much :) |
Hi @andyabc123 , I put @mkraemer 's functions into the demo code. Here is the buyOrder code
You will need to replace the accessKey and the secretKey, and the price and amount. Hope it helps. Regards |
Thank you very much,it's work now;) Andy
|
Faced 401 error yesterday on Android. The core of problem was in BTCChinaDigest (digestParams): |
Hello,
Firstly, thanks for an incredible library! Love it!
I am having trouble using the new BTCChina support. I always get a 401; even when using the BTCChinaTradeDemo example. Any advice or help appreciated. Here is the trace output:
The text was updated successfully, but these errors were encountered: